Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BlackBerry browser version number #36

Open
mrjgreen opened this issue Mar 28, 2015 · 1 comment
Open

BlackBerry browser version number #36

mrjgreen opened this issue Mar 28, 2015 · 1 comment

Comments

@mrjgreen
Copy link
Contributor

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!

@waldbaerkoch
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants