Skip to content

Commit 599ef16

Browse files
committed
Merge branch '2.4-develop-php74-pr42' into web-api-pr
2 parents ddf0732 + e6c5850 commit 599ef16

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/internal/Magento/Framework/View/Helper/PathPattern.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function translatePatternFromGlob($path)
3939
protected function translateGroupsFromGlob($pattern)
4040
{
4141
preg_match_all('~\\\\\\{[^,\\}]+(?:,[^,\\}]*)*\\\\\\}~', $pattern, $matches, PREG_OFFSET_CAPTURE);
42-
for ($index = count($matches[0]) - 1; $index >= 0; $index -= 1) {
42+
for ($index = count($matches[0]) - 1; $index >= 0; $index--) {
4343
list($match, $offset) = $matches[0][$index];
4444
$replacement = substr_replace($match, '(?:', 0, 2);
4545
$replacement = substr_replace($replacement, ')', -2);
@@ -65,9 +65,9 @@ protected function translateGroupsFromGlob($pattern)
6565
protected function translateCharacterGroupsFromGlob($pattern)
6666
{
6767
preg_match_all('~\\\\\\[(\\\\\\!)?[^\\]]+\\\\\\]~i', $pattern, $matches, PREG_OFFSET_CAPTURE);
68-
for ($index = count($matches[0]) - 1; $index >= 0; $index -= 1) {
68+
for ($index = count($matches[0]) - 1; $index >= 0; $index--) {
6969
list($match, $offset) = $matches[0][$index];
70-
$exclude = !empty($matches[1][$index]);
70+
$exclude = !(empty($matches[1][$index]) || empty($matches[1][$index][0]));
7171
$replacement = substr_replace($match, '[' . ($exclude ? '^' : ''), 0, $exclude ? 4 : 2);
7272
$replacement = substr_replace($replacement, ']', -2);
7373
$replacement = str_replace('\\-', '-', $replacement);

0 commit comments

Comments
 (0)