smarty
smarty copied to clipboard
Allow/Deny inline constants
Adding var $allow_inline_constants to SmartyClass and using it in templateparser. This way you can globally deny use of inline constants without $smarty.const. prefix to avoid various ambiguities. Just set $Smarty->allow_inline_constants = false. Defaults to true for backwards compatibility.
Closes #554
Missing tests.
I found function calls like {if strpos(…) !== false} broken with my first version, so I changed it a bit. But this is only speculative trial and error, cause I honestly don't know exactly how the templateparser works. So this should definitely be reviewed by someone, who is familiar with the parser syntax. This one could then also write the corresponding tests.