Skip to content

Conversation

artcs
Copy link

@artcs artcs commented Apr 14, 2020

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

@AnrDaemon
Copy link
Contributor

Missing tests.

@artcs
Copy link
Author

artcs commented May 10, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Direct access to php constants breaking smarty
2 participants