diff options
author | Christopher Smith <chris@jalakai.co.uk> | 2014-03-05 22:05:14 +0000 |
---|---|---|
committer | Christopher Smith <chris@jalakai.co.uk> | 2014-03-05 22:05:14 +0000 |
commit | 9b4337c6e7bb0fdfa0bffa4294b56b0624b93d79 (patch) | |
tree | 43aa2595c6854e4d8e68843d3f1b0ba2f20f9ebe /inc/search.php | |
parent | f87b5dbbbad408da775ac4c60ceb9f9666280527 (diff) | |
download | rpg-9b4337c6e7bb0fdfa0bffa4294b56b0624b93d79.tar.gz rpg-9b4337c6e7bb0fdfa0bffa4294b56b0624b93d79.tar.bz2 |
refactor to take into account missing value
Diffstat (limited to 'inc/search.php')
-rw-r--r-- | inc/search.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/inc/search.php b/inc/search.php index ee4eef534..89f3e253d 100644 --- a/inc/search.php +++ b/inc/search.php @@ -371,8 +371,12 @@ function search_universal(&$data,$base,$file,$type,$lvl,$opts){ $return = true; } } - if($return && !preg_match('/'.$opts['recmatch'].'/',$file)){ - $return = false; // doesn't match + + if ($return) { + $match = empty($opts['recmatch']) || preg_match('/'.$opts['recmatch'].'/',$file); + if (!$match) { + return false; // doesn't match + } } } |