Browse Source

Update Dirk.php

For a constant as an array key.
Visman 2 years ago
parent
commit
6f0ea1264d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      vendor/artoodetoo/dirk/src/Dirk.php

+ 1 - 1
vendor/artoodetoo/dirk/src/Dirk.php

@@ -174,7 +174,7 @@ class Dirk extends PhpEngine
      */
     protected function compileIf(string $expression): string
     {
-        if (\preg_match('%^\(\s*(\!\s*)?(\$[\w>-]+\[(?:[\'"]\w+[\'"]|\d+)\])\s*\)$%', $expression, $matches)) {
+        if (\preg_match('%^\(\s*(\!\s*)?(\$[\w>-]+\[(?:\w+|[\'"]\w+[\'"])\])\s*\)$%', $expression, $matches)) {
             if (empty($matches[1])) {
                 return "<?php if (! empty{$expression}): ?>";
             } else {