Permalink
Browse files

MDL-34175 automatically fix admin JS links

  • Loading branch information...
1 parent f2867a8 commit 79406900b5498c6059ad16fe278397ae88b0bcbb @skodak skodak committed Jul 5, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/outputrequirementslib.php
View
6 lib/outputrequirementslib.php
@@ -399,6 +399,12 @@ protected function js_fix_url($url) {
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, '?'))) {

0 comments on commit 7940690

Please sign in to comment.