mirror of
https://github.com/moodle/moodle.git
synced 2025-04-19 07:25:30 +02:00
Merge branch 'MDL-81035-main' of https://github.com/HuongNV13/moodle
This commit is contained in:
commit
5c0ad525b0
@ -958,7 +958,13 @@ function initialise_fullme() {
|
||||
throw new moodle_exception('requirecorrectaccess', 'error', '', null,
|
||||
'You called ' . $calledurl .', you should have called ' . $correcturl);
|
||||
}
|
||||
redirect($CFG->wwwroot . $rurl['fullpath'], get_string('wwwrootmismatch', 'error', $CFG->wwwroot), 3);
|
||||
$rfullpath = $rurl['fullpath'];
|
||||
// Check that URL is under $CFG->wwwroot.
|
||||
if (strpos($rfullpath, $wwwroot['path']) === 0) {
|
||||
$rfullpath = substr($rurl['fullpath'], strlen($wwwroot['path']) - 1);
|
||||
$rfullpath = (new moodle_url($rfullpath))->out(false);
|
||||
}
|
||||
redirect($rfullpath, get_string('wwwrootmismatch', 'error', $CFG->wwwroot), 3);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user