Skip to content
Snippets Groups Projects
Commit 8fc62eb4 authored by Peter Rotich's avatar Peter Rotich
Browse files

use str_replace instead of preg_replace - regex caused issues with special chars

parent 0a9fe20d
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
}
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment