Summary | Opera Mobile browser not detected correctly |
Queue | Horde Framework Packages |
Queue Version | FRAMEWORK_3 |
Type | Bug |
State | Resolved |
Priority | 1. Low |
Owners | chuck (at) horde (dot) org |
Requester | jeff (at) emailgoeshere (dot) com |
Created | 01/30/2007 (6734 days ago) |
Due | |
Updated | 10/12/2011 (5018 days ago) |
Assigned | |
Resolved | 02/02/2007 (6731 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
again I believe, horde defaults to a desktop setting. No screen
resolution string is present anymore, but an 'Opera Mobi' string is
present. I suppose adding detection of this string would fix it, but I
have limited (well, no) knowledge of php...
An example of a current user agent string on an Android device:
'Opera/9.80 (Android 2.3.3; Linux; Opera Mobi/ADR-1109081720; U;
en-GB) Presto/2.8.149 Version/11.10'
(The string in 'desktop mode': 'Opera/9.80 (X11; Linux zbov; U; en-GB)
Presto/2.8.149 Version/11.10')
I believe putting user agents mentionig 'Opera Mobi' in the mobile
category would be sensible.
Assigned to Chuck Hagenbuch
State ⇒ Resolved
make sense based on evaluation of user agent strings to mark anything
with what looks like a screen resolution as mobile, but for now it's
much duplicated code. Committed to HEAD and I'll merge it shortly.
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Opera Mobile browser not detected correctly
Queue ⇒ Horde Framework Packages
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.