Permalink
Browse files

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

  • Loading branch information...
1 parent 56f5538 commit ad6c9ad223d5f10985ca78f7c2356c9acb60db10 @skodak skodak committed with Sam Hemelryk Mar 18, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/javascript.php
View
@@ -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;
}

0 comments on commit ad6c9ad

Please sign in to comment.