Description

Zend_Http_UserAgent returns a device type of "mobile" all Opera user-agents that start with "oper", which is currently how most desktop versions of Opera user-agents are formatted. Since there are already other checks for opera mobile and opera mini, the solution seems pretty simple.

Sample user agent:

Opera/9.80 (Windows NT 6.0; U; fi) Presto/2.2.0 Version/10.00

Line 295 in Zend_Http_UserAgent_Mobile tries to match mobile browsers by prefix of the user-agent.

if (self::userAgentStart($userAgent)) {
return true;
}

One of the prefixes that returns a match is "oper", which matches many desktop user-agents of Opera.
Simply removing this prefix from the matching array will still match on Opera mobile/mini user-agents, but will correctly not match on desktop versions of Opera.

Comments

Posted by Jared Ray (jared.ray) on 2010-12-02T11:36:16.000+0000

This patch removes the "oper" prefix from the prefix matching array for Zend_Http_UserAgent_Mobile.

Posted by Jared Ray (jared.ray) on 2011-01-12T11:35:38.000+0000

Note that this fix appears to be in the TRUNK subversion, but not in the 11.2 release, although it was mentioned as fixed in the release notes. I have reopened the ticket to make sure this goes out in the next release.

Posted by Adrian Mester (ilogik) on 2011-01-13T06:53:53.000+0000

The patch appears to be in 1.11.2 (the line "oper" doesn't appear in Mobile.php, but it doesn't solve the issue.
Can someone confirm this?

This bug was inserted in the version 1.11.2 r23584 see ZF-10983 only was done merged by me.
Later I will look to this issue.

Greetings
Ramon

Posted by Jared Ray (jared.ray) on 2011-03-02T13:59:15.000+0000

I confirm that revision 23660 re-introduced this bug. Applying both patches should fix the problem. Problem is not fixed in 1.11.3. To be clear: both 'oper' strings should be removed from {{$_uaSignatures}} and {{$_uaBegin}} otherwise desktop versions of Opera will be matched incorrectly.