From a66f6cd6a081e83b6f23ff62a439adc4c83ef629 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Wed, 27 Jul 2016 12:58:51 +0200 Subject: [PATCH] str_match --- lib/php/nb.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/php/nb.php b/lib/php/nb.php index 628a280c..76be10a4 100644 --- a/lib/php/nb.php +++ b/lib/php/nb.php @@ -560,19 +560,18 @@ class NB { // Match } elseif(preg_match('/['.preg_quote('*?[]!').']/',$pattern)) { - - #if (strpos($pattern,'*') !== false or strpos($pattern,'') !== false $match = fnmatch($pattern,$string,FNM_CASEFOLD); - #var_dump($not); // Default } else { + if (strtolower($pattern)=='null') { $pattern = ''; if (!$string) $string = 0; } - #debug("$pattern = $string"); + $match = (strtolower($pattern) == strtolower($string)); + } return (bool)($not ? !$match : $match); -- 2.47.3