Add `\wcf\getMinorVersion()`
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 20 Aug 2020 11:48:25 +0000 (13:48 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 20 Aug 2020 11:48:25 +0000 (13:48 +0200)
wcfsetup/install/files/lib/core.functions.php
wcfsetup/install/files/lib/system/io/HttpFactory.class.php
wcfsetup/install/files/lib/system/style/StyleCompiler.class.php

index 5fc1a3232c4a3cecee7d09bf413a09a485a5b34c..e0588f1671aa2d3ebc02123c1dad1ac9df91ca0d 100644 (file)
@@ -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 {
index 6158b4a0401edb044a85069d22298d179966321b..4657461a9edf392d7148d4d53834aa9e3137a8b1 100644 (file)
@@ -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();
        }
        
        /**
index 7f9a11e70143255188098f94d8915343afb11b79..947bb2630459cabf65b7b56b5bb3bce221665178 100644 (file)
@@ -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