From 63abb48e56c35cdb1f4fcbc2746517f75a8c3cd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Pawe=C5=82czak?= Date: Tue, 20 Jul 2021 15:51:58 +0200 Subject: [PATCH] MDL-69061 core: Fix admin path replacement with path to $CFG->admin --- lib/classes/component.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/classes/component.php b/lib/classes/component.php index 2a6eae85d4a..7ddf84fc92b 100644 --- a/lib/classes/component.php +++ b/lib/classes/component.php @@ -440,7 +440,7 @@ $cache = '.var_export($cache, true).'; $path = $CFG->admin; } if (strpos($path, 'admin/') === 0) { - $path = $CFG->admin . substr($path, 0, 5); + $path = $CFG->admin . substr($path, 5); } } @@ -461,7 +461,7 @@ $cache = '.var_export($cache, true).'; 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}"; }