Use native fetchMap instead of own while loop
authorjoshuaruesweg <ruesweg@woltlab.com>
Tue, 4 Aug 2020 12:59:04 +0000 (14:59 +0200)
committerjoshuaruesweg <ruesweg@woltlab.com>
Tue, 4 Aug 2020 12:59:04 +0000 (14:59 +0200)
wcfsetup/install/files/lib/system/style/StyleCompiler.class.php

index 6868a9904f7d634398e3185db0da781ebcb3e2ed..76f825fbdaf07001aed9dcfddf6b98cc684936a5 100644 (file)
@@ -79,9 +79,7 @@ class StyleCompiler extends SingletonFactory {
                        ORDER BY        variable.variableID ASC";
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute();
-               while ($row = $statement->fetchArray()) {
-                       $variables[$row['variableName']] = $row['defaultValue'];
-               }
+               $variables = $statement->fetchMap('variableName', 'defaultValue');
                
                // see https://github.com/WoltLab/WCF/issues/2636
                if (empty($variables['wcfPageThemeColor'])) {