mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 02:16:41 +02:00
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 <Ryan.Panning@district196.org> for reporting this issue and for suggesting a fix.
This commit is contained in:
parent
821ab27c19
commit
bbbdfc8610
2 changed files with 40 additions and 0 deletions
|
@ -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!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue