diff --git a/composer.json b/composer.json index 5fc87aee..d208389b 100644 --- a/composer.json +++ b/composer.json @@ -72,7 +72,10 @@ ], "config": { "optimize-autoloader": true, - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "phpstan/extension-installer": true + } }, "extra": { "hooks": { diff --git a/src/ZM/global_functions.php b/src/ZM/global_functions.php index ac223c53..6253de9f 100644 --- a/src/ZM/global_functions.php +++ b/src/ZM/global_functions.php @@ -156,16 +156,16 @@ function match_args(string $pattern, string $subject) $exp = explode('*', $pattern); $i = 0; foreach ($exp as $k => $v) { - if (empty($v) && $k === 0) { + if ($v === '' && $k === 0) { continue; } - if (empty($v) && $k === count($exp) - 1) { + if ($v === '' && $k === count($exp) - 1) { $subject .= '^EOL'; $v = '^EOL'; } $cur_var = ''; $ori = $i; - while (($a = mb_substr($subject, $i, mb_strlen($v))) !== $v && !empty($a)) { + while (($a = mb_substr($subject, $i, mb_strlen($v))) !== $v && $a !== '') { $cur_var .= mb_substr($subject, $i, 1); ++$i; }