Skip to content

Strict regular expressions for [);/ ] #6389

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

Merged
merged 5 commits into from
Oct 19, 2020
Merged

Conversation

sanchezzzhak
Copy link
Collaborator

@sanchezzzhak sanchezzzhak commented Oct 13, 2020

in this PR, all regular expression endings [);/ ] are replaced with(?:[);/ ]|$)
This will allow us to identify the device that is written at the end of the useragent, as in issue #5749

 Deezer/5.4.21.97 (Android; 7.1.1; Mobile; fr) WIKO WIM Lite
 Deezer/5.4.22.54 (Android; 4.4.2; Mobile; fr) LOGICOM L-EMENT 400
... etc

@sanchezzzhak sanchezzzhak requested a review from sgiehl October 13, 2020 20:36
@sanchezzzhak
Copy link
Collaborator Author

sanchezzzhak commented Oct 13, 2020

Of course, we can add a "space" or ";" in useragent, then all these changes are not necessary

https://github.com/matomo-org/device-detector/blob/master/Parser/ParserAbstract.php#L184-L186

preg_match($regex, "{$this->userAgent} ", $matches)

@sgiehl
Copy link
Member

sgiehl commented Oct 19, 2020

@sanchezzzhak can you solve the conflicts, will do a review afterwards...

# Conflicts:
#	regexes/device/mobiles.yml

Fix tests
@sanchezzzhak sanchezzzhak changed the title 5749 1 Strict regular expressions for [);/ ] Oct 19, 2020
@sgiehl sgiehl merged commit 48f13cd into matomo-org:master Oct 19, 2020
@sanchezzzhak sanchezzzhak deleted the 5749_1 branch September 3, 2021 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants