<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>Opera Mobile browser not detected correctly</title> 
  <pubDate>Fri, 10 Apr 2026 07:55:27 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/4953</link> 
  <atom:link rel="self" type="application/rss+xml" title="Opera Mobile browser not detected correctly" href="https://bugs.horde.org/ticket/4953/rss" /> 
  <description>Opera Mobile browser not detected correctly</description> 
 
   
   
  <item> 
   <title>Opera Mobile browser (not Opera Mini) has two modes of opera</title> 
   <description>Opera Mobile browser (not Opera Mini) has two modes of operation: one where it identifies as a &quot;Desktop&quot; computer and one where it identifies as a &quot;Handheld.&quot;  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&#039;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 &quot;/var/www/[mydomain]/htdocs/lib/Horde/Browser.php&quot;]



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 &quot;/var/www/[mydomain]/htdocs/lib/Horde/Browser.php&quot;]



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



                if (preg_match(&#039;/; (120x160|240x280|240x320|320x320)\)/&#039;, $this-&gt;_agent)) {

                    $this-&gt;_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&#039;t provide a patch because I wasn&#039;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.</description> 
   <pubDate>Tue, 30 Jan 2007 20:12:58 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/4953#t29012</link> 
  </item> 
   
  <item> 
   <title>Right now I think having the detection in both cases is righ</title> 
   <description>Right now I think having the detection in both cases is right. It may 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&#039;s much duplicated code. Committed to HEAD and I&#039;ll merge it shortly.</description> 
   <pubDate>Fri, 02 Feb 2007 03:46:21 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/4953#t29086</link> 
  </item> 
   
  <item> 
   <title>Detection of recent Opera Mobile browsers (in &#039;mobile mode&#039;)</title> 
   <description>Detection of recent Opera Mobile browsers (in &#039;mobile mode&#039;) fails again I believe, horde defaults to a desktop setting. No screen resolution string is present anymore, but an &#039;Opera Mobi&#039; 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:

&#039;Opera/9.80 (Android 2.3.3; Linux; Opera Mobi/ADR-1109081720; U; en-GB) Presto/2.8.149 Version/11.10&#039;

(The string in &#039;desktop mode&#039;: &#039;Opera/9.80 (X11; Linux zbov; U; en-GB) Presto/2.8.149 Version/11.10&#039;)

I believe putting user agents mentionig &#039;Opera Mobi&#039; in the mobile category would be sensible.</description> 
   <pubDate>Wed, 12 Oct 2011 15:15:49 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/4953#t68148</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
