Assign helperFunctions before doing extract

This way we avoid possiblity of rewriting it from within the context.

Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
Michal Čihař 2016-06-20 12:07:13 +02:00
parent 040822fe5a
commit 2674e503f2

View File

@ -143,11 +143,11 @@ class Template
$template = static::BASE_PATH . $this->name . '.phtml';
try {
$this->set($data);
extract($this->data);
$this->helperFunctions = array_merge(
$this->helperFunctions,
$helperFunctions
);
extract($this->data);
ob_start();
if (file_exists($template)) {
include $template;