MDL-41565 event: Correct inclusion path of observers includefile

This commit is contained in:
Frederic Massart 2013-09-03 15:54:12 +08:00
parent ee788142f2
commit 28f1ff8def

View File

@ -282,6 +282,7 @@ class manager {
if ($CFG->admin !== 'admin' and strpos($observer['includefile'], '/admin/') === 0) {
$observer['includefile'] = preg_replace('|^/admin/|', '/'.$CFG->admin.'/', $observer['includefile']);
}
$observer['includefile'] = $CFG->dirroot . '/' . ltrim($observer['includefile'], '/');
if (!file_exists($observer['includefile'])) {
debugging("Invalid 'includefile' detected in $file observer definition", DEBUG_DEVELOPER);
continue;