Skip to content

Commit

Permalink
Clean up bot regexes (#7549)
Browse files Browse the repository at this point in the history
* Version capture groups have been deleted (since they were not used)
---------

Co-authored-by: Liviu-Mihail Concioiu <[email protected]>
  • Loading branch information
biochimia and liviuconcioiu committed Feb 12, 2024
1 parent 9933f94 commit 10c995f
Show file tree
Hide file tree
Showing 2 changed files with 136 additions and 136 deletions.
2 changes: 1 addition & 1 deletion Parser/AbstractParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ protected function matchUserAgent(string $regex): ?array
$matches = [];

// only match if useragent begins with given regex or there is no letter before it
$regex = '/(?:^|[^A-Z0-9\-_]|[^A-Z0-9\-]_|sprd-|MZ-)(?:' . \str_replace('/', '\/', $regex) . ')/i';
$regex = '/(?:^|[^A-Z0-9_-]|[^A-Z0-9-]_|sprd-|MZ-)(?:' . \str_replace('/', '\/', $regex) . ')/i';

try {
if (\preg_match($regex, $this->userAgent, $matches)) {
Expand Down
Loading

0 comments on commit 10c995f

Please sign in to comment.