Is there a way to add trusted_constants wihout hacking?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
mike12
New Member
New Member
Posts: 3
Joined: Fri Jun 29, 2018 5:25 am

Is there a way to add trusted_constants wihout hacking?

Post 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
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

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

Post by Rolf »

You tried to add in your config.php file:

Code: Select all

$config['permissive_smarty'] = 1;
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
mike12
New Member
New Member
Posts: 3
Joined: Fri Jun 29, 2018 5:25 am

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

Post by mike12 »

Hi Rolf. Yes, it works.

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

thanks
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

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

Post by Rolf »

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Post Reply

Return to “CMSMS Core”