From 408e22ff866da2c152e7d60d9d3fc001b18339be Mon Sep 17 00:00:00 2001 From: niel Date: Tue, 15 Apr 2014 14:24:41 +0100 Subject: [PATCH] Fixing regexes to allow Windows' file paths to work. --- nzedb/build/nZEDb.xml | 2 +- nzedb/db/DbUpdate.php | 2 +- nzedb/utility/Utility.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nzedb/build/nZEDb.xml b/nzedb/build/nZEDb.xml index c7ed376e12..4b455975f2 100755 --- a/nzedb/build/nZEDb.xml +++ b/nzedb/build/nZEDb.xml @@ -4,7 +4,7 @@ 209 0.3 - 6978 + 7000 1 diff --git a/nzedb/db/DbUpdate.php b/nzedb/db/DbUpdate.php index 022911e46a..1bf8a2c6dd 100755 --- a/nzedb/db/DbUpdate.php +++ b/nzedb/db/DbUpdate.php @@ -175,7 +175,7 @@ public function processPatches(array $options = []) $fp = fopen($file, 'r'); $patch = fread($fp, filesize($file)); - if (preg_match($options['regex'], $file, $matches) && $matches['patch'] > 9) { + if (preg_match($options['regex'], str_replace('\\', '/', $file), $matches) && $matches['patch'] > 9) { $patch = $matches['patch']; $setPatch = true; } else if (preg_match("/UPDATE `?site`? SET `?value`? = '?(?P\d+)'? WHERE `?setting`? = 'sqlpatch'/i", $patch, $matches)) { diff --git a/nzedb/utility/Utility.php b/nzedb/utility/Utility.php index 6cdb6f975e..60a78b69bf 100755 --- a/nzedb/utility/Utility.php +++ b/nzedb/utility/Utility.php @@ -28,7 +28,7 @@ static public function getDirFiles (array $options = null) break; case !empty($options['ext']) && $fileinfo->getExtension() != $options['ext']; break; - case !preg_match($options['regex'], $file): + case !preg_match($options['regex'], str_replace('\\', '/', $file)): break; default: $files[] = $fileinfo->getPathname();