Skip to content

Commit

Permalink
Fixing regexes to allow Windows' file paths to work.
Browse files Browse the repository at this point in the history
  • Loading branch information
niel committed Apr 15, 2014
1 parent 7a600fd commit 408e22f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nzedb/build/nZEDb.xml
Expand Up @@ -4,7 +4,7 @@
<db>209</db>
<git>
<tag>0.3</tag>
<commit>6978</commit>
<commit>7000</commit>
<hooks>
<precommit>1</precommit>
<!-- this is the version of the pre-commit file in githooks NOT the files it calls -->
Expand Down
2 changes: 1 addition & 1 deletion nzedb/db/DbUpdate.php
Expand Up @@ -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<patch>\d+)'? WHERE `?setting`? = 'sqlpatch'/i", $patch, $matches)) {
Expand Down
2 changes: 1 addition & 1 deletion nzedb/utility/Utility.php
Expand Up @@ -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();
Expand Down

0 comments on commit 408e22f

Please sign in to comment.