Skip to content

Commit adaca40

Browse files
committed
regexp: \z replaced with D modifier
1 parent b8d3a7c commit adaca40

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Forms/Validator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public static function validateUrl(IControl $control): bool
253253
*/
254254
public static function validatePattern(IControl $control, string $pattern, bool $caseInsensitive = false): bool
255255
{
256-
$regexp = "\x01^(?:$pattern)\\z\x01u" . ($caseInsensitive ? 'i' : '');
256+
$regexp = "\x01^(?:$pattern)$\x01Du" . ($caseInsensitive ? 'i' : '');
257257
foreach (static::toArray($control->getValue()) as $item) {
258258
$value = $item instanceof Nette\Http\FileUpload ? $item->getName() : $item;
259259
if (!Strings::match((string) $value, $regexp)) {
@@ -275,7 +275,7 @@ public static function validatePatternCaseInsensitive(IControl $control, string
275275
*/
276276
public static function validateNumeric(IControl $control): bool
277277
{
278-
return (bool) Strings::match($control->getValue(), '#^\d+\z#');
278+
return (bool) Strings::match($control->getValue(), '#^\d+$#D');
279279
}
280280

281281

0 commit comments

Comments
 (0)