MDL-32683 use slashargument urls for theme javascript files

This commit is contained in:
Petr Skoda
2012-05-05 15:31:27 +02:00
parent 7070b7f261
commit ecbad2ad1c
2 changed files with 23 additions and 4 deletions
+16 -3
View File
@@ -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');