smarty icon indicating copy to clipboard operation
smarty copied to clipboard

Allow/Deny inline constants

Open artcs opened this issue 5 years ago • 2 comments
trafficstars

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

artcs avatar Apr 14 '20 20:04 artcs

Missing tests.

AnrDaemon avatar Apr 17 '20 17:04 AnrDaemon

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.

artcs avatar May 10 '20 18:05 artcs