From 76e481b9ceb13380b9adba7dd41e6a9356bb28c1 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Thu, 14 Aug 2025 18:17:20 +0100 Subject: [PATCH] MDL-86311 core: ensure component is normalised prior to comparison. --- public/lib/classes/router/util.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/public/lib/classes/router/util.php b/public/lib/classes/router/util.php index eada7c17d8b..1c2011feeda 100644 --- a/public/lib/classes/router/util.php +++ b/public/lib/classes/router/util.php @@ -293,14 +293,11 @@ class util { public static function normalise_component_path( string $component, ): string { - if ($component === 'core') { - return $component; - } [$type, $subsystem] = \core\component::normalize_component($component); - if ($type === 'core') { + if ($type === 'core' && $subsystem !== null) { return str_replace('core_', '', $subsystem); } - return $component ?? ''; + return $component; } }