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

View File

@ -167,7 +167,9 @@ function cpm_breakdown_comic_filename($filename, $allow_override = false) {
"m" => '[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;
if (strtotime($date) === false) { return false; }