Skip to content
Permalink
Browse files

regexp: \z replaced with D modifier

  • Loading branch information...
dg committed Jul 11, 2019
1 parent 2d0f4e6 commit d81baa6ce649f65e6321bb1f40ff16c58be0811c
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/Routing/Route.php
@@ -235,7 +235,7 @@ public function constructUrl(array $params, Nette\Http\UrlScript $refUrl): ?stri
$params[$name] = $meta[self::FILTER_OUT]($params[$name]);
}
if (isset($meta[self::PATTERN]) && !preg_match("#(?:{$meta[self::PATTERN]})\\z#A", rawurldecode((string) $params[$name]))) {
if (isset($meta[self::PATTERN]) && !preg_match("#(?:{$meta[self::PATTERN]})$#DA", rawurldecode((string) $params[$name]))) {
return null; // pattern not match
}
}
@@ -359,7 +359,7 @@ private function setMask(string $mask, array $metadata): void
}
if (strpbrk($mask, '?<>[]') === false) {
$this->re = '#' . preg_quote($mask, '#') . '/?\z#A';
$this->re = '#' . preg_quote($mask, '#') . '/?$#DA';
$this->sequence = [$mask];
$this->metadata = $metadata;
return;
@@ -490,7 +490,7 @@ private function setMask(string $mask, array $metadata): void
}
$this->aliases = $aliases;
$this->re = '#' . $re . '/?\z#A';
$this->re = '#' . $re . '/?$#DA';
$this->metadata = $metadata;
$this->sequence = $sequence;
}

0 comments on commit d81baa6

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