[TYPO3-core] FYI24: #10649: Add user agent detection for FireFox, Camino, Safari, Chrome and iPhone

Benjamin Mack benni at typo3.org
Tue Mar 10 12:28:09 CET 2009


Hey Dmitry,

you're aware that this might break current typoscript conditions?

I have a site with TSconfig conditions to match all Mozilla5 browsers:

[browser = netscape]&&[version > 4]
	...
[GLOBAL]

I just had three browsers running, I got this:

  * Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en; rv:1.8.1.19) 
Gecko/20081212 Camino/1.6.6 (like Firefox/2.0.0.19)
  * Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b2) 
Gecko/20081201 Firefox/3.1b2
  * Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us) 
AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16

So they'd all match these options. Also, it is currently possible to 
check for useragents like this:

       [useragent = *Safari*]

Right?

So: Should we provide a note in the installer, in the NEWS.txt?

One more thing: We also need to update the "Pending Documentation" page 
once this is commited.

Also by reviewing, you do a:
   $tmp = strstr($useragent,'FireFox/');
should be a "stristr" for that :)

Additionally (which is not really an issue for this RFC), we 
could/should use "strpos !== false" in the checks instead of strstr, so 
it's faster?

All the best,
Benni.


More information about the TYPO3-team-core mailing list