ua-parser / uap-php

PHP implementation of ua-parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Patch Minor Version Is Always Ignored

toni-rmc opened this issue · comments

Consider these two user agent strings.

1 - Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36 OPR/33.0.1990.115

2 - Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36

As you can see in browsers versions there is a 4th number marking "patch minor".
This 4th number is more and more common in modern devices and I think you should add support for it.

Changing regex (for Opera string )from this:

'regex' => '(?:Chrome).*(OPR)/(\d+).(\d+).(\d+)'

to this:

'regex' => '(?:Chrome).*(OPR)/(\d+).(\d+).(\d+)(?:.(\d+))?'

did not help.

I think you should add some code support for this.

Thank you.

Should be fixed nowadays