Skip to content

Commit

Permalink
MDL-69061 core: Fix admin path replacement with path to $CFG->admin
Browse files Browse the repository at this point in the history
  • Loading branch information
adamtppaw authored and junpataleta committed Jan 11, 2022
1 parent a9e8056 commit de33b20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/classes/component.php
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ protected static function fetch_subsystems() {
$path = $CFG->admin;
}
if (strpos($path, 'admin/') === 0) {
$path = $CFG->admin . substr($path, 0, 5);
$path = $CFG->admin . substr($path, 5);
}
}

Expand All @@ -465,7 +465,7 @@ protected static function fetch_plugintypes() {
foreach (self::fetch_component_source('plugintypes') as $plugintype => $path) {
// Replace admin/ with the config setting.
if ($CFG->admin !== 'admin' && strpos($path, 'admin/') === 0) {
$path = $CFG->admin . substr($path, 0, 5);
$path = $CFG->admin . substr($path, 5);
}
$types[$plugintype] = "{$CFG->dirroot}/{$path}";
}
Expand Down

0 comments on commit de33b20

Please sign in to comment.