Skip to content

Commit

Permalink
fixed cache key normalizing
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiehl committed May 29, 2014
1 parent 5381ab4 commit 863ae43
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Parser/ParserAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function getName()
protected function getRegexes()
{
$cacheKey = 'DeviceDetector-regexes-'.$this->getName();
$cacheKey = preg_replace('([^a-z0-9_-]+)', '', $cacheKey);
$cacheKey = preg_replace('/([^a-z0-9_-]+)/i', '', $cacheKey);
$regexList = $this->getCache()->get($cacheKey);
if (empty($regexList)) {
$regexList = Spyc::YAMLLoad(dirname(__DIR__).DIRECTORY_SEPARATOR.$this->fixtureFile);
Expand Down Expand Up @@ -165,7 +165,7 @@ protected function preMatchOverall()
static $overAllMatch;

$cacheKey = $this->parserName.'-all';
$cacheKey = preg_replace('([^a-z0-9_-]+)', '', $cacheKey);
$cacheKey = preg_replace('/([^a-z0-9_-]+)/i', '', $cacheKey);

if (empty($overAllMatch)) {
$overAllMatch = $this->getCache()->get($cacheKey);
Expand Down

0 comments on commit 863ae43

Please sign in to comment.