diff --git a/lib/configonlylib.php b/lib/configonlylib.php index 9ceee1e58fd..791d2461695 100644 --- a/lib/configonlylib.php +++ b/lib/configonlylib.php @@ -123,10 +123,15 @@ function min_get_slash_argument() { $relativepath = ''; - if (stripos($_SERVER['SERVER_SOFTWARE'], 'iis') !== false) { + if (!empty($_GET['file']) and strpos($_GET['file'], '/') === 0) { + // server is using url rewriting, most probably IIS + return $_GET['file']; + + } else if (stripos($_SERVER['SERVER_SOFTWARE'], 'iis') !== false) { if (isset($_SERVER['PATH_INFO']) and $_SERVER['PATH_INFO'] !== '') { $relativepath = urldecode($_SERVER['PATH_INFO']); } + } else { if (isset($_SERVER['PATH_INFO'])) { $relativepath = $_SERVER['PATH_INFO']; diff --git a/lib/javascript-static.js b/lib/javascript-static.js index ae4068b7b2d..19c584f9476 100644 --- a/lib/javascript-static.js +++ b/lib/javascript-static.js @@ -1793,7 +1793,7 @@ M.util.load_flowplayer = function() { if (M.cfg.jsrev == -10) { var jsurl = M.cfg.wwwroot + '/lib/flowplayer/flowplayer-3.2.8.min.js'; } else { - var jsurl = M.cfg.wwwroot + '/lib/javascript.php?file=/lib/flowplayer/flowplayer-3.2.8.min.js&rev=' + M.cfg.jsrev; + var jsurl = M.cfg.wwwroot + '/lib/javascript.php?jsfile=/lib/flowplayer/flowplayer-3.2.8.min.js&rev=' + M.cfg.jsrev; } var fileref = document.createElement('script'); fileref.setAttribute('type','text/javascript'); diff --git a/lib/javascript.php b/lib/javascript.php index 8ec42631c86..380334f52ad 100644 --- a/lib/javascript.php +++ b/lib/javascript.php @@ -43,7 +43,7 @@ if ($slashargument = min_get_slash_argument()) { } else { $rev = min_optional_param('rev', 0, 'INT'); - $file = min_optional_param('file', '', 'RAW'); + $file = min_optional_param('jsfile', '', 'RAW'); // 'file' would collide with URL rewriting! } // some security first - pick only files with .js extension in dirroot diff --git a/lib/outputrequirementslib.php b/lib/outputrequirementslib.php index e1d88322b97..2d32ec9db60 100644 --- a/lib/outputrequirementslib.php +++ b/lib/outputrequirementslib.php @@ -406,7 +406,7 @@ class page_requirements_manager { } if (!empty($CFG->cachejs) and !empty($CFG->jsrev) and $CFG->jsrev > 0 and strpos($url, '/lib/editor/') !== 0 and substr($url, -3) === '.js') { if (empty($CFG->slasharguments)) { - return new moodle_url($CFG->httpswwwroot.'/lib/javascript.php', array('rev'=>$CFG->jsrev, 'file'=>$url)); + return new moodle_url($CFG->httpswwwroot.'/lib/javascript.php', array('rev'=>$CFG->jsrev, 'jsfile'=>$url)); } else { $returnurl = new moodle_url($CFG->httpswwwroot.'/lib/javascript.php'); $returnurl->set_slashargument('/'.$CFG->jsrev.$url); diff --git a/theme/yui_combo.php b/theme/yui_combo.php index 77fe9011816..bafcc1ef62f 100644 --- a/theme/yui_combo.php +++ b/theme/yui_combo.php @@ -209,12 +209,17 @@ function combo_not_found($message = '') { } function combo_params() { - // note: buggy or misconfigured IIS does return the query string in REQUEST_URL - if (isset($_SERVER['REQUEST_URI']) and strpos($_SERVER['REQUEST_URI'], '?') !== false) { + if (isset($_SERVER['QUERY_STRING']) and strpos($_SERVER['QUERY_STRING'], 'file=/') === 0) { + // url rewriting + $slashargument = substr($_SERVER['QUERY_STRING'], 6); + return array($slashargument, true); + + } else if (isset($_SERVER['REQUEST_URI']) and strpos($_SERVER['REQUEST_URI'], '?') !== false) { $parts = explode('?', $_SERVER['REQUEST_URI'], 2); return array($parts[1], false); } else if (isset($_SERVER['QUERY_STRING']) and strpos($_SERVER['QUERY_STRING'], '?') !== false) { + // note: buggy or misconfigured IIS does return the query string in REQUEST_URI return array($_SERVER['QUERY_STRING'], false); } else if ($slashargument = min_get_slash_argument()) {