Commit 2bdb96c7 authored by Aaron Wells's avatar Aaron Wells
Browse files

Dwoo includes were breaking when the plugintype was written as uppercase

Bug 1231755

Change-Id: I198f04bb652d3220bcceb77c685edcae2fe68e52
parent eab8977c
......@@ -43,8 +43,16 @@ class Dwoo_Template_Mahara extends Dwoo_Template_File {
throw new SystemException("Invalid template path \"{$file}\"");
}
// Keep the original string for logging purposes
$dwooref = $file;
list($plugintype, $pluginname, $file) = $parts;
// Since we use $plugintype as part of a file path, we should whitelist it
$plugintype = strtolower($plugintype);
if (!in_array($plugintype, plugin_types())) {
throw new SystemException("Invalid plugintype in Dwoo template \"{$dwooref}\"");
}
// Get the relative path for this particular plugin
require_once(get_config('docroot') . $plugintype . '/lib.php');
$pluginpath = call_static_method(generate_class_name($plugintype), 'get_theme_path', $pluginname);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment