Browse Source

Update Container.php

Escaping the percent character.
Visman 4 years ago
parent
commit
56a872bbb1
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/Core/Container.php

+ 2 - 2
app/Core/Container.php

@@ -173,9 +173,9 @@ class Container
                 } else {
                 } else {
                     // partial string substitution casts value to string
                     // partial string substitution casts value to string
                     $value = \preg_replace_callback(
                     $value = \preg_replace_callback(
-                        '~%([a-z0-9_]+(?:\.[a-z0-9_]+)*)%~i',
+                        '~\\\%|%([a-z0-9_]+(?:\.[a-z0-9_]+)*)%~i',
                         function ($matches) {
                         function ($matches) {
-                            return $this->__get($matches[1]);
+                            return '\\%' == $matches[0] ? '%' : $this->__get($matches[1]);
                         },
                         },
                         $value
                         $value
                     );
                     );