uap-core icon indicating copy to clipboard operation
uap-core copied to clipboard

BlackBerry browser version number

Open mrjgreen opened this issue 9 years ago • 1 comments

I'm seeing lots user agent string like this, which seem to be valid:

BlackBerry 9670/63.94.0.711 ldrepos/XXXXX-123 Configuration/XXXXXX-123 VendorID/123

Current Behaviour

This appears to be parsing the same number for browser version and device model (9670).

The string is matching rule: (Black[bB]erry)\s?(\d+)

Expected Behaviour

It seems that the browser version is not available in this case, so the expected output could just be BlackBerry. In this case the regex would instead be: (Black[bB]erry)

Is anybody able to confirm whether or not this is the intended behaviour? If somebody can confirm what the expected output should be I will attempt to create a PR with some tests.

Additional Information

Full parse result below:

    "user_agent": {
        "family": "BlackBerry",
        "major": "9670",
        "minor": null,
        "patch": null,
        "regex": "@(Black[bB]erry)\\s?(\\d+)@"
    },
    "os": {
        "family": "BlackBerry OS",
        "major": "63",
        "minor": "94",
        "patch": "0",
        "regex": "@(Black[Bb]erry)[0-9a-z]+\/(\\d+)\\.(\\d+)\\.(\\d+)(?:\\.(\\d+))?@"
    },
    "device": {
        "device": "BlackBerry 9670",
        "brand": null,
        "model": "9670",
        "regex": "@Black[Bb]erry([0-9]+)@"
    }

Thanks!

mrjgreen avatar Mar 28 '15 12:03 mrjgreen

IMO a better guess would be to use the number following the slash as both OS and browser number.

waldbaerkoch avatar Jan 19 '17 09:01 waldbaerkoch