MDL-46775: Fix call to unavailable function when loading an invalid JS file

This commit is contained in:
Simon Coggins
2014-08-12 14:34:17 +12:00
parent c1b4e91098
commit 1a68d6e7e1
2 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -35,7 +35,8 @@ require_once("$CFG->dirroot/lib/jslib.php");
if ($slashargument = min_get_slash_argument()) {
$slashargument = ltrim($slashargument, '/');
if (substr_count($slashargument, '/') < 2) {
image_not_found();
header('HTTP/1.0 404 not found');
die('Slash argument must contain both a revision and a file path');
}
// image must be last because it may contain "/"
list($themename, $rev, $type) = explode('/', $slashargument, 3);