MDL-31703 allow serving of JavaScript from unsupported '/' dirroot

This commit is contained in:
Petr Skoda 2012-03-18 17:28:59 +01:00
parent a2b30aa852
commit 265b1434b0

View File

@ -46,7 +46,11 @@ foreach ($files as $fsfile) {
// does not exist
continue;
}
if (strpos($jsfile, $CFG->dirroot . DIRECTORY_SEPARATOR) !== 0) {
if ($CFG->dirroot === '/') {
// Some shared hosting sites serve files directly from '/',
// this is NOT supported, but at least allow JS when showing
// errors and warnings.
} else if (strpos($jsfile, $CFG->dirroot . DIRECTORY_SEPARATOR) !== 0) {
// hackers - not in dirroot
continue;
}