Skip to content
Permalink
Browse files

regexp: \z replaced with D modifier

  • Loading branch information...
dg committed Jul 11, 2019
1 parent 5891443 commit 14164e1ddd69e9c5f627ff82a10874b3f5bba5fe
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/Utils/Finder.php
@@ -164,7 +164,7 @@ private static function buildPattern(array $masks): ?string
$pattern[] = $prefix . strtr(preg_quote($mask, '#'),
['\*\*' => '.*', '\*' => '[^/]*', '\?' => '[^/]', '\[\!' => '[^', '\[' => '[', '\]' => ']', '\-' => '-']);
}
return $pattern ? '#/(' . implode('|', $pattern) . ')\z#i' : null;
return $pattern ? '#/(' . implode('|', $pattern) . ')$#Di' : null;
}
@@ -299,7 +299,7 @@ public function limitDepth(int $depth): self
public function size(string $operator, int $size = null): self
{
if (func_num_args() === 1) { // in $operator is predicate
if (!preg_match('#^(?:([=<>!]=?|<>)\s*)?((?:\d*\.)?\d+)\s*(K|M|G|)B?\z#i', $operator, $matches)) {
if (!preg_match('#^(?:([=<>!]=?|<>)\s*)?((?:\d*\.)?\d+)\s*(K|M|G|)B?$#Di', $operator, $matches)) {
throw new Nette\InvalidArgumentException('Invalid size predicate format.');
}
[, $operator, $size, $unit] = $matches;
@@ -322,7 +322,7 @@ public function size(string $operator, int $size = null): self
public function date(string $operator, $date = null): self
{
if (func_num_args() === 1) { // in $operator is predicate
if (!preg_match('#^(?:([=<>!]=?|<>)\s*)?(.+)\z#i', $operator, $matches)) {
if (!preg_match('#^(?:([=<>!]=?|<>)\s*)?(.+)$#Di', $operator, $matches)) {
throw new Nette\InvalidArgumentException('Invalid date predicate format.');
}
[, $operator, $date] = $matches;

0 comments on commit 14164e1

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