Skip to content

Commit 9b38083

Browse files
committed
Fixed: for few of the matching types, make sure the matching value is not an empty string.
1 parent ffc42b5 commit 9b38083

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/Processor.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,25 +328,25 @@ public function matchParameterValue($match, $value)
328328
}
329329

330330
// If a scalar is a ctype alnum with underscores, dashes and spaces.
331-
if ($matchType == 'ctype_special' && is_scalar($value)) {
331+
if ($matchType == 'ctype_special' && is_scalar($value) && $value != '') {
332332
$value = str_replace([' ', '_', '-', ','], '', $value);
333333
$isClean = (bool) (@preg_match('/^[\w$\x{0080}-\x{FFFF}]*$/u', $value) > 0);
334334
return $isClean === $matchValue;
335335
}
336336

337337
// If a scaler is a ctype digit.
338-
if ($matchType == 'ctype_digit' && is_scalar($value)) {
338+
if ($matchType == 'ctype_digit' && is_scalar($value) && $value != '') {
339339
return @ctype_digit($value) === $matchValue;
340340
}
341341

342342
// If a scaler is a ctype alnum.
343-
if ($matchType == 'ctype_alnum' && is_scalar($value)) {
343+
if ($matchType == 'ctype_alnum' && is_scalar($value) && $value != '') {
344344
$isClean = (bool) (@preg_match('/^[\w$\x{0080}-\x{FFFF}]*$/u', $value) > 0);
345345
return $isClean === $matchValue;
346346
}
347347

348348
// If a scalar is numeric.
349-
if ($matchType == 'is_numeric' && is_scalar($value)) {
349+
if ($matchType == 'is_numeric' && is_scalar($value) && $value != '') {
350350
return @is_numeric($value) === $matchValue;
351351
}
352352

0 commit comments

Comments
 (0)