mirror of
https://github.com/Mibew/handlebars.php.git
synced 2024-11-15 08:44:12 +03:00
Merge pull request #43 from Mibew/fix_helpers_auto_esc
Use handlebars escape function for helpers' results
This commit is contained in:
commit
8650422483
@ -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