mirror of
https://github.com/Mibew/handlebars.php.git
synced 2024-11-15 08:44:12 +03:00
Use handlebars escape function for helpers' results
This commit is contained in:
parent
3a3ab36c5f
commit
b6a903fee8
@ -407,9 +407,16 @@ class Template
|
||||
$current[Tokenizer::NAME] = $name;
|
||||
$current[Tokenizer::ARGS] = implode(' ', $args);
|
||||
$result = $this->_section($context, $current);
|
||||
if ( $escaped ) {
|
||||
$result = htmlspecialchars($result);
|
||||
|
||||
if ($escaped) {
|
||||
$escape_args = $this->handlebars->getEscapeArgs();
|
||||
array_unshift($escape_args, $result);
|
||||
$result = call_user_func_array(
|
||||
$this->handlebars->getEscape(),
|
||||
array_values($escape_args)
|
||||
);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user