GaretJax / phpbrowscap

Standalone replacement for php's native get_browser() function
MIT License
429 stars 69 forks source link

Some browsers incorrectly parsed due to regular expressions order. #35

Closed quentin389 closed 11 years ago

quentin389 commented 11 years ago

Browser Mozilla/5.0 (Mac OS X) AppleWebKit/ (KHTML, like Gecko, Safari/) Arora/0.9

should match (same as in get_browser())

[Mozilla/5.0 (*Mac OS X*) AppleWebKit/* (KHTML, like Gecko, Safari/*) *Arora/0.9*]
Parent=Arora 0.9
Platform="MacOSX"
Win32=false

but instead it matches

[Mozilla/5.0 (*Mac OS X*) AppleWebKit/* (KHTML, like Gecko, Safari/*) *Arora/0.?*]
Parent=Arora Generic
Platform="MacOSX"
Win32=false

because the order of regular expressions is diiferent than used by get_browser()

quentin389 commented 11 years ago

From what I can see, while this issue is a generic one, only Arora has this problem. This specific situation doesn't seem to be present in any other regular expressions.

quentin389 commented 11 years ago

Fixed