From 8fc62eb4c7430e2113f6f4ed6ab51d675f440b0f Mon Sep 17 00:00:00 2001 From: Peter Rotich <peter@osticket.com> Date: Wed, 21 Nov 2012 18:05:24 -0500 Subject: [PATCH] use str_replace instead of preg_replace - regex caused issues with special chars --- include/class.variable.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/include/class.variable.php b/include/class.variable.php index f83ba61be..7d49ce592 100644 --- a/include/class.variable.php +++ b/include/class.variable.php @@ -98,7 +98,7 @@ class VariableReplacer { if(!($vars=$this->_parse($input))) return $input; - return preg_replace($this->_delimit(array_keys($vars)), array_values($vars), $input); + return str_replace(array_keys($vars), array_values($vars), $input); } function _resolveVar($var) { @@ -134,14 +134,5 @@ class VariableReplacer { return $vars; } - - //Helper function - will be replaced by a lambda function (PHP 5.3+) - function _delimit($val, $d='/') { - - if($val && is_array($val)) - return array_map(array($this, '_delimit'), $val); - - return $d.$val.$d; - } } ?> -- GitLab