|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
federoasio Smarty n00b
Joined: 12 Jan 2015 Posts: 2
|
Posted: Tue Jan 13, 2015 3:41 pm Post subject: Smarty_Security not filtering registered plugins tags. |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Jan 13, 2015 10:20 pm Post subject: |
|
|
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 |
|
federoasio Smarty n00b
Joined: 12 Jan 2015 Posts: 2
|
Posted: Wed Jan 14, 2015 12:12 pm Post subject: |
|
|
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 |
|
|
|
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
|