Skip to content
Permalink
Browse files

regexp: \z replaced with D modifier

  • Loading branch information...
dg committed Jul 11, 2019
1 parent b8d3a7c commit adaca40120cc5ab99df7477870335a349b209760
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/Forms/Validator.php
@@ -253,7 +253,7 @@ public static function validateUrl(IControl $control): bool
*/
public static function validatePattern(IControl $control, string $pattern, bool $caseInsensitive = false): bool
{
$regexp = "\x01^(?:$pattern)\\z\x01u" . ($caseInsensitive ? 'i' : '');
$regexp = "\x01^(?:$pattern)$\x01Du" . ($caseInsensitive ? 'i' : '');
foreach (static::toArray($control->getValue()) as $item) {
$value = $item instanceof Nette\Http\FileUpload ? $item->getName() : $item;
if (!Strings::match((string) $value, $regexp)) {
@@ -275,7 +275,7 @@ public static function validatePatternCaseInsensitive(IControl $control, string
*/
public static function validateNumeric(IControl $control): bool
{
return (bool) Strings::match($control->getValue(), '#^\d+\z#');
return (bool) Strings::match($control->getValue(), '#^\d+$#D');
}

0 comments on commit adaca40

Please sign in to comment.
You can’t perform that action at this time.