mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-34175 automatically fix admin JS links
This commit is contained in:
parent
2cbdaa77ea
commit
8a8914cd41
@ -399,6 +399,12 @@ class page_requirements_manager {
|
||||
if ($url instanceof moodle_url) {
|
||||
return $url;
|
||||
} else if (strpos($url, '/') === 0) {
|
||||
// Fix the admin links if needed.
|
||||
if ($CFG->admin !== 'admin') {
|
||||
if (strpos($url, "/admin/") === 0) {
|
||||
$url = preg_replace("|^/admin/|", "/$CFG->admin/", $url);
|
||||
}
|
||||
}
|
||||
if (debugging()) {
|
||||
// check file existence only when in debug mode
|
||||
if (!file_exists($CFG->dirroot . strtok($url, '?'))) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user