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 0c63990 commit f4783db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/classes/component.php
Expand Up @@ -443,7 +443,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 @@ -464,7 +464,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 f4783db

Please sign in to comment.