Bug 42136: prevent cgi, directory, and file plugins from use in user-entered templates
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
a2a92356b8
commit
268863392e
|
|
@ -1916,6 +1916,11 @@ sub _process_tt {
|
|||
EVAL_PERL => 0,
|
||||
ABSOLUTE => 0,
|
||||
RELATIVE => 0,
|
||||
PLUGINS => {
|
||||
cgi => 'Koha::Template::Plugin::noop',
|
||||
directory => 'Koha::Template::Plugin::noop',
|
||||
file => 'Koha::Template::Plugin::noop',
|
||||
},
|
||||
PLUGIN_BASE => 'Koha::Template::Plugin',
|
||||
COMPILE_EXT => $use_template_cache ? '.ttc' : '',
|
||||
COMPILE_DIR => $use_template_cache ? C4::Context->config('template_cache_dir') : '',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
package Koha::Template::Plugin::noop;
|
||||
|
||||
use Modern::Perl;
|
||||
|
||||
use base qw( Template::Plugin );
|
||||
|
||||
1;
|
||||
|
|
@ -61,6 +61,11 @@ sub process_tt {
|
|||
EVAL_PERL => 0,
|
||||
ABSOLUTE => 0,
|
||||
RELATIVE => 0,
|
||||
PLUGINS => {
|
||||
cgi => 'Koha::Template::Plugin::noop',
|
||||
directory => 'Koha::Template::Plugin::noop',
|
||||
file => 'Koha::Template::Plugin::noop',
|
||||
},
|
||||
PLUGIN_BASE => 'Koha::Template::Plugin',
|
||||
COMPILE_EXT => $use_template_cache ? '.ttc' : '',
|
||||
COMPILE_DIR => $use_template_cache ? C4::Context->config('template_cache_dir') : '',
|
||||
|
|
|
|||
Loading…
Reference in New Issue