[Templates] Is there a way to disable Plugins?

Josh Rosenbaum josh at infogears.com
Mon Jul 14 19:36:22 BST 2008


chakkit at ibiz.co.th wrote:
> I’m planning to develop a system that public users can fully change the 
> template by their own.
> 
> I’m concerning about security, how can I turn off some plugins or load 
> only what I need?

use Template;
use Template::Plugins;

$Template::Plugins::STD_PLUGINS = {};
$Template::Plugins::PLUGIN_BASE = '';

Then just define your plugins via the PLUGINS config option.

my $template_config = {
  PLUGINS => {
    'math' => 'Template::Plugin::Math',
  }
};
my $template = Template->new($template_config);

-- Josh



More information about the templates mailing list