From 37e3115cb472a8d8b16be183c045220835e1fbef Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 15 Aug 2023 12:11:08 +0200 Subject: don't always add core/common and core/main during "sorting" Signed-off-by: Robin Appelman --- lib/public/Util.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/public/Util.php b/lib/public/Util.php index 63ed9e835c7..1d03c35a9b7 100644 --- a/lib/public/Util.php +++ b/lib/public/Util.php @@ -212,7 +212,12 @@ class Util { $sortedScripts = $sortedScripts ? array_merge(...array_values(($sortedScripts))) : []; // Override core-common and core-main order - array_unshift($sortedScripts, 'core/js/common', 'core/js/main'); + if (in_array('core/js/main', $sortedScripts)) { + array_unshift($sortedScripts, 'core/js/main'); + } + if (in_array('core/js/common', $sortedScripts)) { + array_unshift($sortedScripts, 'core/js/common'); + } return array_unique($sortedScripts); } -- cgit v1.2.3