[Tickets #4953] Opera Mobile browser not detected correctly

bugs@bugs.horde.org bugs at bugs.horde.org
Tue Jan 30 12:12:59 PST 2007


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=4953
-----------------------------------------------------------------------
 Ticket             | 4953
 Created By         | jeff at emailgoeshere.com
 Summary            | Opera Mobile browser not detected correctly
 Queue              | Horde Framework Packages
 Version            | FRAMEWORK_3
 Type               | Bug
 State              | Unconfirmed
 Priority           | 1. Low
 Owners             | 
-----------------------------------------------------------------------


jeff at emailgoeshere.com (2007-01-30 12:12) wrote:

Opera Mobile browser (not Opera Mini) has two modes of operation: one where
it identifies as a "Desktop" computer and one where it identifies as a
"Handheld."  Both modes however are detected as a non-mobile browser,
making things like automatically using MIMP instead of IMP impossible.

I put in some debug statements: here's a user-agent string from Opera
Mobile as a desktop:

Jan 27 01:55:10 HORDE [notice] [horde] mozilla/4.0 (compatible; msie 6.0;
windows nt 5.1; sv1) opera 8.60 [en] [on line 282 of
"/var/www/[mydomain]/htdocs/lib/Horde/Browser.php"]

And as a handheld:

Jan 27 01:54:03 HORDE [notice] [horde] mozilla/4.0 (compatible; msie 6.0;
windows ce; ppc; 240x320) opera 8.60 [en] [on line 282 of
"/var/www/[mydomain]/htdocs/lib/Horde/Browser.php"]

Note that there is already code in Browser.php which will detect this:

                if (preg_match('/; (120x160|240x280|240x320|320x320)\)/',
$this->_agent)) {
                    $this->_mobile = true;
                }

However, this code currently is only executed in the Internet Explorer
section.  Copying this code and moving it to the Opera section, i.e. at
line 296 of Browser.php, solved my problem, i.e. I get sent to IMP or MIMP
correctly depending on what Opera identifies as.  I didn't provide a patch
because I wasn't sure if the best way to solve this is to have this check
repeated twice in the code for the different browsers, or to pull it out
and have it somewhere higher up in the chain.

Version of Browser.php:

 * $Horde: framework/Browser/Browser.php,v 1.153.2.47 2006/07/17 09:52:00
jan Exp $

from Gentoo Horde package version 3.1.3.




More information about the bugs mailing list