From: Tim Düsterhus Date: Wed, 28 Apr 2021 13:08:31 +0000 (+0200) Subject: Fix preload finder regex in StyleCompiler::extractPreloadRequests() X-Git-Tag: 5.4.0_Alpha_1~31 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=114298e14c033f04bffee4923257a7efe2119dab;p=GitHub%2FWoltLab%2FWCF.git 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. --- 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 []; }