web/lib/Zend/Config/Json.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
equal deleted inserted replaced
805:5e7a0fedabdf 807:877f952ae2bd
    14  *
    14  *
    15  * @category  Zend
    15  * @category  Zend
    16  * @package   Zend_Config
    16  * @package   Zend_Config
    17  * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
    17  * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @license   http://framework.zend.com/license/new-bsd     New BSD License
    18  * @license   http://framework.zend.com/license/new-bsd     New BSD License
    19  * @version   $Id: Json.php 23294 2010-11-05 00:27:34Z ramon $
    19  * @version   $Id: Json.php 24810 2012-05-17 21:20:12Z rob $
    20  */
    20  */
    21 
    21 
    22 /**
    22 /**
    23  * @see Zend_Config
    23  * @see Zend_Config
    24  */
    24  */
   218      */
   218      */
   219     protected function _replaceConstants($value)
   219     protected function _replaceConstants($value)
   220     {
   220     {
   221         foreach ($this->_getConstants() as $constant) {
   221         foreach ($this->_getConstants() as $constant) {
   222             if (strstr($value, $constant)) {
   222             if (strstr($value, $constant)) {
   223                 $value = str_replace($constant, constant($constant), $value);
   223                 // handle backslashes that may represent windows path names for instance
       
   224                 $replacement = str_replace('\\', '\\\\', constant($constant));
       
   225                 $value = str_replace($constant, $replacement, $value);
   224             }
   226             }
   225         }
   227         }
   226         return $value;
   228         return $value;
   227     }
   229     }
   228 
   230