From 10b832b8209097e702a2765bf5bb878957869120 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 3 Nov 2010 10:29:31 -0700 Subject: [PATCH] Fix mobile browser detection. --- lib/WebGUI/Form/HTMLArea.pm | 2 +- lib/WebGUI/Session/Style.pm | 19 ------------------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/lib/WebGUI/Form/HTMLArea.pm b/lib/WebGUI/Form/HTMLArea.pm index b90b2ef2a..fee001c30 100644 --- a/lib/WebGUI/Form/HTMLArea.pm +++ b/lib/WebGUI/Form/HTMLArea.pm @@ -187,7 +187,7 @@ Renders an HTML area field. sub toHtml { my $self = shift; ##Do not display a rich editor on any mobile browser. - if ($self->session->style->mobileBrowser) { + if ($self->session->request->browser->mobile) { return $self->SUPER::toHtml; } my $i18n = WebGUI::International->new($self->session); diff --git a/lib/WebGUI/Session/Style.pm b/lib/WebGUI/Session/Style.pm index 18a02af19..92fe74b7e 100644 --- a/lib/WebGUI/Session/Style.pm +++ b/lib/WebGUI/Session/Style.pm @@ -110,25 +110,6 @@ sub makePrintable { #------------------------------------------------------------------- -=head2 mobileBrowser ( ) - -Returns true if the user's browser matches any of the mobile browsers set in the config file. - -=cut - -sub mobileBrowser { - my $self = shift; - my $session = $self->session; - my $ua = $session->env->get('HTTP_USER_AGENT'); - for my $mobileUA (@{ $session->config->get('mobileUserAgents') }) { - if ($ua =~ m/$mobileUA/) { - return 1; - } - } -} - -#------------------------------------------------------------------- - =head2 useMobileStyle Returns a true value if we are on a mobile display.