MDL-34175 automatically fix admin JS links

This commit is contained in:
Petr Škoda
2012-07-10 12:44:06 +12:00
committed by Sam Hemelryk
parent 5d7f0fcc1e
commit 0f7e3d045d
+6
View File
@@ -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, '?'))) {