Skip to content

Commit 9ea5d2b

Browse files
committed
Changed: ctype_alnum and ctype_special to cover unicode scenarios.
Added: .gitattributes.
1 parent e809c33 commit 9ea5d2b

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/tests export-ignore

src/Processor.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,9 @@ public function matchParameterValue($match, $value)
329329

330330
// If a scalar is a ctype alnum with underscores, dashes and spaces.
331331
if ($matchType == 'ctype_special' && is_scalar($value)) {
332-
$value = str_replace([' ', '_', '-'], '', $value);
333-
return @ctype_alnum($value) === $matchValue;
332+
$value = str_replace([' ', '_', '-', ','], '', $value);
333+
$isClean = (bool) (@preg_match('/^[\w$\x{0080}-\x{FFFF}]*$/u', $value) > 0);
334+
return $isClean === $matchValue;
334335
}
335336

336337
// If a scaler is a ctype digit.
@@ -340,7 +341,8 @@ public function matchParameterValue($match, $value)
340341

341342
// If a scaler is a ctype alnum.
342343
if ($matchType == 'ctype_alnum' && is_scalar($value)) {
343-
return @ctype_alnum($value) === $matchValue;
344+
$isClean = (bool) (@preg_match('/^[\w$\x{0080}-\x{FFFF}]*$/u', $value) > 0);
345+
return $isClean === $matchValue;
344346
}
345347

346348
// If a scalar is numeric.

0 commit comments

Comments
 (0)