MDL-34175 automatically fix admin JS links
This commit is contained in:
@@ -362,6 +362,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, '?'))) {
|
||||
|
||||
Reference in New Issue
Block a user