MDL-21400 thems and JS now using the same script naming convention and parameter style

This commit is contained in:
Petr Skoda
2010-02-07 13:08:46 +00:00
parent 6597e6b7ae
commit baeb20bba3
4 changed files with 20 additions and 25 deletions
+5 -6
View File
@@ -30,16 +30,15 @@ require('../config.php'); // this stops immediately at the beginning of lib/setu
$file = min_optional_param('file', '', 'SAFEPATH');
$rev = min_optional_param('rev', 0, 'INT');
if (empty($file) or strpos($file, '/') !== 0 or !preg_match('/\.js$/', $file)) {
die;
}
$jspath = $CFG->dirroot.$file;
if (file_exists($jspath)) {
send_cached_js($jspath);
if (empty($file) or strpos($file, '/') !== 0 or !preg_match('/\.js$/', $file) or !file_exists($jspath)) {
header('HTTP/1.0 404 not found');
die('JS file was not found, sorry.');
}
send_cached_js($jspath);
//=================================================================================
//=== utility functions ==