Page 1 of 1

Is there a way to add trusted_constants wihout hacking?

Posted: Fri Jun 29, 2018 6:00 am
by mike12
Hello. I' m new. Now i would like to use a constant in my templates like this:

Code: Select all

{$smarty.const.MYCONSTANT}
result:

Code: Select all

{$smarty.const.MYCONSTANT}" (secure mode) constants not permitted
Seems to me normal because in 'class Smarty_Security' the arr

Code: Select all

public $trusted_constants = array();
... is empty.

Is there a 'dynamic' and/or intended way to allow some constants wihout hacking? (a value of siteprefs or .ini of smarty?)

CMSMS Ver. 202

greetings
mike

Re: Is there a way to add trusted_constants wihout hacking?

Posted: Fri Jun 29, 2018 6:58 am
by Rolf
You tried to add in your config.php file:

Code: Select all

$config['permissive_smarty'] = 1;

Re: Is there a way to add trusted_constants wihout hacking?

Posted: Fri Jun 29, 2018 7:32 am
by mike12
Hi Rolf. Yes, it works.

And by way... i also noticed the other options in class.cms_config.php
:-)

thanks

Re: Is there a way to add trusted_constants wihout hacking?

Posted: Fri Jun 29, 2018 8:14 am
by Rolf