Fix mobile browser detection.
This commit is contained in:
parent
3f49d25575
commit
10b832b820
2 changed files with 1 additions and 20 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue