Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

constants work without prefix with PHP 7.3 and Smarty 3.1.34-dev-6 #534

Open
ophian opened this issue Feb 23, 2019 · 3 comments
Open

constants work without prefix with PHP 7.3 and Smarty 3.1.34-dev-6 #534

ophian opened this issue Feb 23, 2019 · 3 comments

Comments

@ophian
Copy link

ophian commented Feb 23, 2019

Since I am using PHP 7.3, I realised that defined constants actually work as {EXAMPLE} right out the box, without the $smarty.const. prefix.
Is that an intentionell Smarty behaviour to be kept in future or is this PHP just being smart?

@AnrDaemon
Copy link
Contributor

It was added before the end of 2014. You can control behavior with SmartySecurity class, if you want to disallow it.

@artcs
Copy link

artcs commented Feb 21, 2020

You can control behavior with SmartySecurity class, if you want to disallow it.

That's not a helpful answer to the question. You only can disallow the use of php constants alltogether via Smarty_Security, so that neither {EXAMPLE} nor {$smarty.const.EXAMPLE} will work. There is currntly no hack-free way to disallow only {EXAMPLE} while keeping {$smarty.const.EXAMPLE} working.

See the discussion in the above mentioned issue.

@AnrDaemon
Copy link
Contributor

Frankly, I see no real use case for PHP constants in templates outside debugging.
Template and config variables are all that matters.

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

No branches or pull requests

3 participants