add preg_quote to user provided PCRE

This commit is contained in:
John Bintz 2009-08-27 13:44:55 -04:00
parent daa489032b
commit c50a9ee3b1
1 changed files with 3 additions and 1 deletions

View File

@ -167,7 +167,9 @@ function cpm_breakdown_comic_filename($filename, $allow_override = false) {
"m" => '[0-9]{2,2}', "m" => '[0-9]{2,2}',
"d" => '[0-9]{2,2}')); "d" => '[0-9]{2,2}'));
if (preg_match("/^(${pattern})(.*)\.[^\.]+$/", $filename, $matches) > 0) { $pattern = preg_quote($pattern, "#");
if (preg_match("#^(${pattern})(.*)\.[^\.]+$#", $filename, $matches) > 0) {
list($all, $date, $title) = $matches; list($all, $date, $title) = $matches;
if (strtotime($date) === false) { return false; } if (strtotime($date) === false) { return false; }