[mimp] browser match for AvantGo and Danger hiptop

Ben Poliakoff benp at reed.edu
Mon Aug 2 14:49:22 PDT 2004


Thanks to Jan's earlier pointer to the Horde Wiki I got composite auth
working properly (sending the user to Imp or Mimp depending on whether
the browser is recognized as mobile).

Unfortunately the browser matching code in the Horde Framework file
"Browser.php" doesn't seem to work for the Danger hiptop device (which
advertises compatability with AvantGo, in hopes of piggybacking on
AvantGo's ubiquity).

The hiptop sends a UserAgent string that looks like this:

    Mozilla/5.0 (compatible; AvantGo 3.2; ProxiNet; Danger hiptop 1.0)

The AvantGo "browser" sends a UserAgent string that looks like this:

    Mozilla/3.0 (compatible; AvantGo 3.2)

Neither of these are matched by the following snippet from Browser.php
(since the UserAgent string appears to be "Mozilla/5.0" for the hiptop
and "Mozilla/3.0" for the AvantGo browser):

     } elseif (strpos($this->_lowerAgent, 'avantgo') !== false) {
                    $this->setBrower('avantgo');
                    $this->_mobile = true;
     }

Is there a way that I can match against string elements within the
parentheses?

The Browser matching code works great for several other mobile browsers.
Xiino, which sends a UserAgent string that looks like this:

    "Xiino/1.0.9E [en] (v. 4.1; 153x130; g4)"

Is detected properly....

Ben

-- 
_______________________________________________________________________
Ben Poliakoff                                     email: benp at reed.edu
Reed College                                        tel:  503-788-6674
Unix System Administrator                          PGP key: 0x6AF52019
PGP fingerprint:    A131 F813 7A0F C5B7 E74D  C972 9118 A94D 6AF5 2019


More information about the mimp mailing list