MDL-49800 core_output: Templates are not allowed in sub directories

This commit is contained in:
Frederic Massart 2015-04-15 14:03:23 +08:00
parent 9b67b43b21
commit 60de7df148

View File

@ -49,6 +49,9 @@ class mustache_filesystem_loader extends \Mustache_Loader_FilesystemLoader {
throw new coding_exception('Templates names must be specified as "componentname/templatename" (' . $name . ' requested) ');
}
list($component, $templatename) = explode('/', $name, 2);
if (strpos($templatename, '/') !== false) {
throw new coding_exception('Templates cannot be placed in sub directories (' . $name . ' requested)');
}
return parent::getFileName($templatename);
}
}