Closed Manawyrm closed 5 years ago
Looks good, could you please post an example?
Sure.
Rain\Tpl::configure( array(
"base_url" => null,
"tpl_dir" => "tmp/tpl",
"cache_dir" => "tmp/tpl",
"path_replace" => false,
) );
$template = '
Demo: {HI12345}
yada yada demo question? Look here: https://myurl.de/{$somevariable}/
';
$tpl = new Rain\Tpl();
$response = $tpl->drawString( $template, true );
This causes a crash when evaluating the template.
PHP Parse error: syntax error, unexpected '}' in
/var/www/tmp/tpl/238ab0eeb8453154befb4aa481560096.s.rtpl.php on line 3
@Manawyrm just tested your code change. It does fix that issue. Thanks so much for working on it!
Hi,
this fixes an issue in the ternary parser. This causes the template parsing to fail in a case where { ? : accidentally follow in a template, even when the { is followed by a } (and is thus a valid tag).
This fixes the issue by disallowing a } within the ternary expression and fixes the issue.
I believe this is also the same issue reported by @st2cs in https://github.com/feulf/raintpl3/issues/153 .
Thanks, Tobias