Clear all previous template variables before replacing Macros in FriendicaSmartyEngine
- Prevents variables leaking between replaceMacros() calls
This commit is contained in:
@@ -83,6 +83,8 @@ final class FriendicaSmartyEngine extends TemplateEngine
|
|||||||
Hook::callAll('template_vars', $arr);
|
Hook::callAll('template_vars', $arr);
|
||||||
$vars = $arr['vars'];
|
$vars = $arr['vars'];
|
||||||
|
|
||||||
|
$this->smarty->clearAllAssign();
|
||||||
|
|
||||||
foreach ($vars as $key => $value) {
|
foreach ($vars as $key => $value) {
|
||||||
if ($key[0] === '$') {
|
if ($key[0] === '$') {
|
||||||
$key = substr($key, 1);
|
$key = substr($key, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user