From 3a046f181e773a43dad89abe90190f4fe90df13c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 20 Aug 2020 13:48:25 +0200 Subject: [PATCH] Add `\wcf\getMinorVersion()` --- wcfsetup/install/files/lib/core.functions.php | 4 ++++ wcfsetup/install/files/lib/system/io/HttpFactory.class.php | 4 +--- .../install/files/lib/system/style/StyleCompiler.class.php | 5 ----- 3 files changed, 5 insertions(+), 8 deletions(-) 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 -- 2.20.1