Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-34175 automatically fix admin JS links

  • Loading branch information...
commit 0f7e3d045d0b9a2c24f466b42a3c2b3ef5032eca 1 parent 5d7f0fc
@skodak skodak authored samhemelryk committed
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/outputrequirementslib.php
View
6 lib/outputrequirementslib.php
@@ -362,6 +362,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, '?'))) {
Please sign in to comment.
Something went wrong with that request. Please try again.