diff options
author | Christopher Finke <chris@efinke.com> | 2016-05-13 08:50:41 -0700 |
---|---|---|
committer | Christopher Finke <chris@efinke.com> | 2016-05-13 08:50:41 -0700 |
commit | 4df5d6a7195204761abce353d3e278cd3e4690d1 (patch) | |
tree | bbe0df8cc5fb5698f78c8038858b3f9e083b2e93 | |
parent | 077f79f13ddc8efa4cb10c2c041eb4b50037e0e3 (diff) | |
download | webgrind-4df5d6a7195204761abce353d3e278cd3e4690d1.zip webgrind-4df5d6a7195204761abce353d3e278cd3e4690d1.tar.gz webgrind-4df5d6a7195204761abce353d3e278cd3e4690d1.tar.bz2 |
Escape dot in regular expression.
Without the escape, you'll match any filename that ends with "webgrind", even if the character before the string is not a period.
-rw-r--r-- | library/FileHandler.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/FileHandler.php b/library/FileHandler.php index 7bcce61..d505a81 100644 --- a/library/FileHandler.php +++ b/library/FileHandler.php @@ -50,7 +50,7 @@ class Webgrind_FileHandler{ * @return void string */ private function getInvokeUrl($file){ - if (preg_match('/.webgrind$/', $file)) + if (preg_match('/\.webgrind$/', $file)) return 'Webgrind internal'; // Grab name of invoked file. @@ -203,4 +203,4 @@ class Webgrind_FileHandler{ } return round($size, $precision).$sizes[$total]; } -}
\ No newline at end of file +} |