[TYPO3-core] RFC: #14201: getBrowserInfo delivers wrong info

Susanne Moog typo3 at susannemoog.de
Tue Apr 27 19:42:54 CEST 2010


On 26.04.2010 11:03, Steffen Kamper wrote:
> Hi,
> 
> This is an SVN patch request.
> 
> Type: bugfix
> 
> Bugtracker references:
> http://bugs.typo3.org/view.php?id=14201
> 
> Branches:
> trunk, 4_3
> 
> As the most userAgents starts with Mozilla, we always get "netscape" as
> result which is wrong and doesn't help.
> 
> The parsing of UA is not precise and compares the wrong way.
> 
> This patch use a regular expression and a list of the known browsers,
> it's easy to maintain and to add new browsers.
> 
> As the TS condition only need one browser, and some browsers return more
> than one result, the last result is taken as main browser info. But an
> additional array "all" contains all founded browsers in UA.
> 
> The result parsing isn't perfect as there are many possible UA strings,
> but it reflects the most common browsers.
> 
> Example on my machine:

+1 by reading and testing with:

Firefox 3.6 on Ubuntu 10.04
Seamonkey 1.1 on Ubuntu 10.04
Konqueror 4.4  on Ubuntu 10.04
Opera 10.01 on Ubuntu 10.04
Flock 2.0 on Ubuntu 10.04

Nice!

Susanne



More information about the TYPO3-team-core mailing list