Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Dec 5, 2018. It is now read-only.

Commit e583a6d

Browse files
committed
Fix a bug in one of the Android regexps.
This regexp: 'Android[\- ][\d]+(?:\.[\d]+){1,2}; *[a-z]{0,2}[_\-]?[A-Za-z]{0,2};? Build' lacks a capturing group (parens) for the device name. This means that it needs to specify the device-name specifically in the yaml file, but it wasn't before. This fixes that. I also re-generated the json file from the yaml by running the second half of convert.py. Auditors: anastassia Test Plan: webapp% python >>> import third_party.user_agents as u >>> u.parse('Mozilla/5.0 (Linux; Android 5.1.99; Build/MRA23D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.106 Mobile Safari/537.36') and it no longer raises an exception. This user-agent was obtained from bigquery like so: SELECT user_agent from logs.requestlogs_20150731 where app_logs.message contains "no such group" group by user_agent
1 parent 5bc3a30 commit e583a6d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

ua_parser/regexes.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

ua_parser/regexes.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4618,6 +4618,7 @@ device_parsers:
46184618
model_replacement: '$1'
46194619
# No build info at all - "Build" follows locale immediately
46204620
- regex: 'Android[\- ][\d]+(?:\.[\d]+){1,2}; *[a-z]{0,2}[_\-]?[A-Za-z]{0,2};? Build'
4621+
device_replacement: 'Generic Smartphone'
46214622
brand_replacement: 'Generic'
46224623
model_replacement: 'Smartphone'
46234624
- regex: 'Android[\- ][\d]+(?:\.[\d]+){1,2}; *\-?[A-Za-z]{2}; *(.+?) Build'

0 commit comments

Comments
 (0)