Skip to content

Commit

Permalink
MDL-31703 allow serving of JavaScript from unsupported '/' dirroot
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak authored and Sam Hemelryk committed Mar 19, 2012
1 parent 56f5538 commit ad6c9ad
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/javascript.php
Expand Up @@ -46,7 +46,11 @@
// 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;
}
Expand Down

0 comments on commit ad6c9ad

Please sign in to comment.