MDL-47073 lib: Replace backslashes with slashes in jquery plugin urls
This patch replaces backslash characters in the generated jQuery plugin URL to forward slashes when slasharguments is disabled and the Moodle server is running on IIS. Thanks to Ryan Panning <[email protected]> for reporting this issue and for suggesting a fix.
This commit is contained in:
@@ -556,6 +556,8 @@ class page_requirements_manager {
|
||||
$path = realpath("$componentdir/jquery/$file");
|
||||
if (strpos($path, $CFG->dirroot) === 0) {
|
||||
$url = $CFG->httpswwwroot.preg_replace('/^'.preg_quote($CFG->dirroot, '/').'/', '', $path);
|
||||
// Replace all occurences of backslashes characters in url to forward slashes.
|
||||
$url = str_replace('\\', '/', $url);
|
||||
$url = new moodle_url($url);
|
||||
} else {
|
||||
// Bad luck, fix your server!
|
||||
|
||||
Reference in New Issue
Block a user