From 9b4337c6e7bb0fdfa0bffa4294b56b0624b93d79 Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Wed, 5 Mar 2014 22:05:14 +0000 Subject: refactor to take into account missing value --- inc/search.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'inc/search.php') 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 + } } } -- cgit v1.2.3