Skip to content
Snippets Groups Projects
Commit abf7e617 authored by Jared Hancock's avatar Jared Hancock
Browse files

Slight optimization for variable replacement

parent 678b9cb3
Branches
Tags
No related merge requests found
......@@ -82,16 +82,14 @@ class VariableReplacer {
if (!$var || !method_exists($obj, 'getVar'))
return "";
$parts = explode('.', $var);
if(($rv = call_user_func(array($obj, 'getVar'), $parts[0]))===false)
list($tag, $remainder) = explode('.', $var, 2);
if(($rv = call_user_func(array($obj, 'getVar'), $tag))===false)
return "";
if(!is_object($rv))
return $rv;
list(, $part) = explode('.', $var, 2);
return $this->getVar($rv, $part);
return $this->getVar($rv, $remainder);
}
function replaceVars($input) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment