]> git.koha-community.org Git - koha.git/commit
Bug 23237: Plugin allow [% INCLUDE %] from template
authorFrédéric Demians <f.demians@tamil.fr>
Sat, 29 Jun 2019 06:55:34 +0000 (08:55 +0200)
committerLucas Gass <lucas@bywatersolutions.com>
Tue, 17 Sep 2019 19:22:30 +0000 (19:22 +0000)
commit99ea979bd68663824d6962be0703bdbd09ae323e
tree400c9d6ef81e7c86a3c74855a2eb90d58d72de3d
parentf97c2951abb8561a9922790a2c7eb1b8b587fc90
Bug 23237: Plugin allow [% INCLUDE %] from template

From a plugin template it is useful to be able to include other templates with
[% INCLUDE %] directives. But TT module is used by Koha with absolute paths.
Relative paths are forbidden for security reasons. A new param [% PLUGIN_DIR %]
allow plugin templates to know where to find plugin home directory.

How to test:

1. Install kitchen-sink plugin.

2. Find tool-step1.tt file, and add this at the begining of the file:
   [% INCLUDE "$PLUGIN_DIR/header.tt" %]
   It ask to include a template header.tt which doesn't exit.

3. Run kitchen-sink plugin tool. You must have this error message:

   Template process failed: file error - _path to plugin
   directory_/Koha/Plugin/Com/ByWaterSolutions/KitchenSink/header.tt: not found

   quod erat demonstrandum

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 8c517d2f2860c08263f44dfde8d3cadea418694e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 57e9d113b65e1f0ff1717ce288a771cfe618326e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Koha/Plugins/Base.pm