[TYPO3-core] RFC: #14230: Match TS browser condition with all delivered browsers

Steffen Kamper info at sk-typo3.de
Wed Apr 28 10:14:16 CEST 2010


Hi Lars,

Lars Houmark schrieb:
> Hi Steffen,
> 
> Steffen Kamper wrote:
>> So simply use the all array for compare and [browser=chrome] will work.
>> Even something like [browser=webkit] works, which allows adding special
>> css for webkit browsers.
> 
> I like the idea. Just your implementation was flawed, as using [browser 
> = chrome] will not work, due to uppercase 'C' in the useragent value.
>

after our talk yesterday i got the idea of the uppercase when lying in 
bed :)

> So changing strpos to stripos in patch line 19 will make it work as 
> expected. I am not sure if it makes sense to bring a space between the 
> key and value but it shouldn't change the functionality, so I'll let 
> others decide :)
> 

the space isn't needed for comparison, i only putted it in for cosmetic 
reasons. Maybe one daywe have a browser name starting with a number, so 
we are safe.

> At the same time I noticed that some 'Array' values was in the string, 
> which came from the all key. Those data is not needed as they are 
> already in the string, so my suggestion is to check for is_array before 
> appending to the string. Have a better one?
>

i hadn't this with my tested browsers, so good you teste ith so many 
browsers, thanks!


> +1 on reading and testing _v2 which is attached, only changing strpos to 
> stripos and is_array check.
>

yes, absolutely fine, +1!
Thanks for your help.

vg Steffen


More information about the TYPO3-team-core mailing list