Skip to content

Commit

Permalink
Simplified regex match storing code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilge committed Aug 22, 2020
1 parent 02b24e5 commit 11fea55
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/CrawlerDetect.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,7 @@ public function isCrawler($userAgent = null)
return false;
}

$result = preg_match("/{$this->compiledRegex}/i", $agent, $matches);

if ($matches) {
$this->matches = $matches;
}

return (bool) $result;
return (bool) preg_match("/{$this->compiledRegex}/i", $agent, $this->matches);
}

/**
Expand Down

0 comments on commit 11fea55

Please sign in to comment.