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

Fix patch version parsing for Facebook and Pinterest app #269

Merged
merged 1 commit into from
Sep 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions regexes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ user_agent_parsers:

# Social Networks
# Facebook
- regex: '\[FB.*;(FBAV)/(\d+)(?:\.(\d+)(?:\.(\d)+)?)?'
- regex: '\[FB.*;(FBAV)/(\d+)(?:\.(\d+)(?:\.(\d+))?)?'
family_replacement: 'Facebook'
# Pinterest
- regex: '\[(Pinterest)/[^\]]+\]'
- regex: '(Pinterest)(?: for Android(?: Tablet)?)?/(\d+)(?:\.(\d+)(?:\.(\d)+)?)?'
- regex: '(Pinterest)(?: for Android(?: Tablet)?)?/(\d+)(?:\.(\d+)(?:\.(\d+))?)?'

# Pale Moon
- regex: '(PaleMoon)/(\d+)\.(\d+)\.?(\d+)?'
Expand Down
12 changes: 12 additions & 0 deletions tests/test_ua.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6471,6 +6471,12 @@ test_cases:
minor: '9'
patch:

- user_agent_string: '[FBAN/FB4A;FBAV/130.0.321;FBBV/149649;FBDM/{density=1.5,width=480,height=800};FBLC/es_ES;FBCR/;FBPN/com.facebook.katana;FBDV/LG-P920;FBSV/2.2.2;]'
family: 'Facebook'
major: '130'
minor: '0'
patch: '321'

- user_agent_string: 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_4 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10B350 [Pinterest/iOS]'
family: 'Pinterest'
major:
Expand Down Expand Up @@ -6525,6 +6531,12 @@ test_cases:
minor: '2'
patch:

- user_agent_string: 'Pinterest for Android/1.1.12 (endeavoru; 4.1.1)'
family: 'Pinterest'
major: '1'
minor: '1'
patch: '12'

- user_agent_string: 'Pinterest/3.2 CFNetwork/672.0.8 Darwin/14.0.0'
family: 'CFNetwork'
major: '672'
Expand Down