mirror of
https://github.com/moodle/moodle.git
synced 2025-06-02 06:05:31 +02:00
MDL-46775: Fix call to unavailable function when loading an invalid JS file
This commit is contained in:
parent
14cb870f46
commit
754313fbb8
@ -35,7 +35,8 @@ require_once("$CFG->dirroot/lib/classes/minify.php");
|
||||
if ($slashargument = min_get_slash_argument()) {
|
||||
$slashargument = ltrim($slashargument, '/');
|
||||
if (substr_count($slashargument, '/') < 1) {
|
||||
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($rev, $file) = explode('/', $slashargument, 2);
|
||||
@ -73,7 +74,8 @@ foreach ($files as $fsfile) {
|
||||
|
||||
if (!$jsfiles) {
|
||||
// bad luck - no valid files
|
||||
die();
|
||||
header('HTTP/1.0 404 not found');
|
||||
die('No valid javascript files found');
|
||||
}
|
||||
|
||||
$etag = sha1($rev.implode(',', $jsfiles));
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user