MDL-34175 automatically fix admin JS links

This commit is contained in:
Petr Škoda 2012-07-05 19:33:06 +02:00
parent 2cbdaa77ea
commit 8a8914cd41

View File

@ -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, '?'))) {