Re: [SMARTY] plugin error
| From: | messju mohr | Date: | Wed, 26 Mar 2003 21:55:24 +0000 |
| Subject: | Re: [SMARTY] plugin error | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8925@lists.php.net to get a copy of this message | ||
On Wed, Mar 26, 2003 at 01:33:22PM -0500, Paul Lockaby wrote:
> I just downloaded Smarty 2.5.0 RC2 and ran into the following problem. I
> have security set to true which prohibits PHP functions to be used as
> modifiers, except those specified in $security_settings. So lemme ask a
> question about that before I get into my problem. Does that affect
> modifiers explicitly set in code? For instance, if I declare a modifier
> explicity like this:
>
> $smarty->register_modifier("strip_tags","strip_tags");
>
> Even though the modifier has the same name as the PHP function, should
> there be a problem?
no it shouldn't be a problem.
> I would think not. But on the other hand, in my
> plugins directory I have a file named modifier.date.php that allows me
> to use the PHP date function in my templates. However, this isn't
> allowed because I didn't explicity allow it?
it is allowed. the modifier list in $security_settings only affects
php-functions that are implicitely also allowed as modifiers. it does
not affect plugins in one of your plugins_dirs. plugins in your
plugins_dirs are always allowed.
> Is this supposed to happen
> like that? I wouldn't think it to, since I'm not really using the PHP
> function, I'm actually using my own modifier, that happens to have the
> same name as a PHP function... is this a bug?
your plugin has precedence over the php-function of the same name. if
you do not want to allow your plugin (wether security is true or
false) you must not put it in one of your plugins_dirs in the first
place.
HTH
messju