MDL-32683 use slashargument urls for theme javascript files
This commit is contained in:
+16
-3
@@ -32,9 +32,22 @@ define('NO_DEBUG_DISPLAY', true);
|
||||
define('ABORT_AFTER_CONFIG', true);
|
||||
require('../config.php'); // this stops immediately at the beginning of lib/setup.php
|
||||
|
||||
$themename = min_optional_param('theme', 'standard', 'SAFEDIR');
|
||||
$rev = min_optional_param('rev', 0, 'INT');
|
||||
$type = min_optional_param('type', 'head', 'RAW');
|
||||
if ($slashargument = min_get_slash_argument()) {
|
||||
$slashargument = ltrim($slashargument, '/');
|
||||
if (substr_count($slashargument, '/') < 2) {
|
||||
image_not_found();
|
||||
}
|
||||
// image must be last because it may contain "/"
|
||||
list($themename, $rev, $type) = explode('/', $slashargument, 3);
|
||||
$themename = min_clean_param($themename, 'SAFEDIR');
|
||||
$rev = min_clean_param($rev, 'INT');
|
||||
$type = min_clean_param($type, 'SAFEDIR');
|
||||
|
||||
} else {
|
||||
$themename = min_optional_param('theme', 'standard', 'SAFEDIR');
|
||||
$rev = min_optional_param('rev', 0, 'INT');
|
||||
$type = min_optional_param('type', 'head', 'RAW');
|
||||
}
|
||||
|
||||
if ($type !== 'head' and $type !== 'footer') {
|
||||
header('HTTP/1.0 404 not found');
|
||||
|
||||
Reference in New Issue
Block a user