Procházet zdrojové kódy

Fix ZF-12177. Patch by Martin Hujer

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@24810 44c647ce-9c0f-0410-b52a-842ac1e357ba
rob před 13 roky
rodič
revize
d41b4a86ff
1 změnil soubory, kde provedl 3 přidání a 1 odebrání
  1. 3 1
      library/Zend/Config/Json.php

+ 3 - 1
library/Zend/Config/Json.php

@@ -220,7 +220,9 @@ class Zend_Config_Json extends Zend_Config
     {
     {
         foreach ($this->_getConstants() as $constant) {
         foreach ($this->_getConstants() as $constant) {
             if (strstr($value, $constant)) {
             if (strstr($value, $constant)) {
-                $value = str_replace($constant, constant($constant), $value);
+                // handle backslashes that may represent windows path names for instance
+                $replacement = str_replace('\\', '\\\\', constant($constant));
+                $value = str_replace($constant, $replacement, $value);
             }
             }
         }
         }
         return $value;
         return $value;