[TYPO3-dev] Caring for t3lib_utility_Client

Steffen Kamper info at sk-typo3.de
Sat Apr 24 13:31:41 CEST 2010


Hi Francois,

Francois Suter schrieb:
> Hi all,
> 
> While working on the documentation I stumbled over the TypoScript 
> condition "browser". The list of client looked totally outdated so I 
> took a peek into the source code to see where it came from. That led me 
> to class "t3lib_utility_Client" and more to the point to the method 
> called "getBrowserInfo".
> 
> The PHPdoc states the following about this method: "Generates an array 
> with abstracted browser information".
> 
> Taking some real-world examples, this information seems a bit too 
> abstracted for me. Indeed whether you use Firefox 3.6, Safari 4 or 
> Chrome 5, you'll get the following result:
> 
> - browser: netscape
> - version: 5
>

this is crap :) I would declare this as bug. It's possible to return 
more reliable information instead only using Mozilla. Example:

Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.1.9) Gecko/20100401 
Ubuntu/9.10 (karmic) Firefox/3.5.9

It's worth to look into and make a better return value.

> This doesn't seem to make a lot of sense. Sure all these browsers send 
> back "Mozilla/5.0" in their user agent string, but I would expect a 
> finer difference in the result. Shouldn't it really return the browser's 
> type (i.e. "firefox", "safari" and "chrome")?
> 
> Furthermore the class refers to some really old stuff, some of which I 
> even had to google (example: "AvantGo", which doesn't even exist 
> anymore...).
> 

These infos are outdated from time to time and shoul be made actual in 
recent versions.

> And further down there's getDeviceType(), which looks just as outdated, 
> to a point where one wonders whether it really still is useful or not.
> 

This could be more important as we have a lot of mobiles used for 
browse. The switch case with strstr isn't precise enough. We have to do 
a research on that.

vg Steffen




More information about the TYPO3-dev mailing list