array_walk doesn't alter keys, fixed

This commit is contained in:
Steve Kamerman 2013-05-22 15:17:54 -04:00
parent 095b7d7f14
commit 0a755cedae

View file

@ -263,10 +263,11 @@ class Builder
*/
public function interpolate($input)
{
$translations = array_walk($this->getInterpolationVars(), function($value, &$key) {
$key = '%'.$key.'%';
});
return strtr($input, $translations);
$trans_table = array();
foreach ($this->getInterpolationVars() as $key => $value) {
$trans_table['%'.$key.'%'] = $value;
}
return strtr($input, $trans_table);
}
/**