From: Tim Düsterhus Date: Thu, 20 Aug 2020 11:48:25 +0000 (+0200) Subject: Add `\wcf\getMinorVersion()` X-Git-Tag: 5.3.0_Alpha_1~22^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3a046f181e773a43dad89abe90190f4fe90df13c;p=GitHub%2FWoltLab%2FWCF.git Add `\wcf\getMinorVersion()` --- diff --git a/wcfsetup/install/files/lib/core.functions.php b/wcfsetup/install/files/lib/core.functions.php index 5fc1a3232c..e0588f1671 100644 --- a/wcfsetup/install/files/lib/core.functions.php +++ b/wcfsetup/install/files/lib/core.functions.php @@ -113,6 +113,10 @@ namespace wcf { return $_SERVER[WCF_REQUEST_ID_HEADER] ?? ''; } + + function getMinorVersion() { + return preg_replace('/^(\d+\.\d+)\..*$/', '\\1', WCF_VERSION); + } } namespace wcf\functions\exception { diff --git a/wcfsetup/install/files/lib/system/io/HttpFactory.class.php b/wcfsetup/install/files/lib/system/io/HttpFactory.class.php index 6158b4a040..4657461a9e 100644 --- a/wcfsetup/install/files/lib/system/io/HttpFactory.class.php +++ b/wcfsetup/install/files/lib/system/io/HttpFactory.class.php @@ -28,9 +28,7 @@ final class HttpFactory { * @return string */ public static function getDefaultUserAgent() { - $version = preg_replace('/^(\d+\.\d+)\..*$/', '\\1', WCF_VERSION); - - return 'WoltLabSuite/'.$version; + return 'WoltLabSuite/'.\wcf\getMinorVersion(); } /** diff --git a/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php b/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php index 7f9a11e701..947bb26304 100644 --- a/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php +++ b/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php @@ -259,11 +259,6 @@ class StyleCompiler extends SingletonFactory { * Compiles SCSS stylesheets for ACP usage. */ public function compileACP() { - if (substr(WCF_VERSION, 0, 3) == '2.1') { - // work-around for wcf2.1 update - return; - } - $files = $this->getCoreFiles(); // ACP uses a slightly different layout