Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Smarty_Security not filtering registered plugins tags.

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
federoasio
Smarty n00b


Joined: 12 Jan 2015
Posts: 2

PostPosted: Tue Jan 13, 2015 3:41 pm    Post subject: Smarty_Security not filtering registered plugins tags. Reply with quote

Hi, I'm trying to use Smarty_Security to filter some functions tags registered with registerPlugin().

$smarty->registerPlugin( 'function', 'hello', array( $this, 'hello'));

And I have the function

public function hola($params, $smarty)
{
return "Hello";
}

And it works great if I include the tag {hello} in my templates.

Now I want to filter this tag, with the security module.
I've tried this

$securityPolicy = new Smarty_Security($this);
$securityPolicy->disabled_tags = array('hello');
$smarty->enableSecurity($securityPolicy);

But it is not working, it works great if the plugin is in my plugins directory but I can't get it working if I register the plugins dynamically.

Any ideas of how to solve this?
Thank you all!
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Tue Jan 13, 2015 10:20 pm    Post subject: Reply with quote

Registered tags are allways assumed to be secure.

It does not make sense that you register a tag and then disbale it by security.
What shall be the purpose of doind this?
Back to top
View user's profile Send private message
federoasio
Smarty n00b


Joined: 12 Jan 2015
Posts: 2

PostPosted: Wed Jan 14, 2015 12:12 pm    Post subject: Reply with quote

Yes I know, but I am working with legacy code and I don't know if these registered tags are secure. I will have to do some code refactoring.
Thank you very much for your response.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP