From 114298e14c033f04bffee4923257a7efe2119dab Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 28 Apr 2021 15:08:31 +0200 Subject: [PATCH] Fix preload finder regex in StyleCompiler::extractPreloadRequests() The previous one did not match preload requests without a trailing semicolon, because a closing brace immediately follows. --- wcfsetup/install/files/lib/system/style/StyleCompiler.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php b/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php index 979df096e1..c1d925c213 100644 --- a/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php +++ b/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php @@ -353,7 +353,7 @@ final class StyleCompiler extends SingletonFactory */ private function extractPreloadRequests(string $css): iterable { - $regex = '/--woltlab-suite-preload:\\s*preload_dummy\\(((?:"(?:\\\\.|[^\\\\"])*"|[^")])+)\\);/'; + $regex = '/--woltlab-suite-preload:\\s*preload_dummy\\(((?:"(?:\\\\.|[^\\\\"])*"|[^")])+)\\)\\s*[;\\}]/'; if (!\preg_match_all($regex, $css, $requests)) { return []; } -- 2.20.1