Skip to content

Commit

Permalink
MDL-46775: Fix call to unavailable function when loading an invalid J…
Browse files Browse the repository at this point in the history
…S file
  • Loading branch information
simoncoggins committed Aug 12, 2014
1 parent 14cb870 commit 754313f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/javascript.php
Expand Up @@ -35,7 +35,8 @@
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);
Expand Down Expand Up @@ -73,7 +74,8 @@

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));
Expand Down
3 changes: 2 additions & 1 deletion theme/javascript.php
Expand Up @@ -35,7 +35,8 @@
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);
Expand Down

0 comments on commit 754313f

Please sign in to comment.