Fixed empty LESS variable values
authorAlexander Ebert <ebert@woltlab.com>
Thu, 25 Oct 2012 16:39:31 +0000 (18:39 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 25 Oct 2012 16:39:31 +0000 (18:39 +0200)
wcfsetup/install/files/lib/data/style/Style.class.php

index 7752d2a9d8374c7c3a2fdb08d75b8b0b212575f3..bb38bd41615b8cdec8a402f7c33138f28e83383f 100644 (file)
@@ -83,7 +83,13 @@ class Style extends DatabaseObject {
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute(array($this->styleID));
                while ($row = $statement->fetchArray()) {
-                       $this->variables[$row['variableName']] = (isset($row['variableValue'])) ? $row['variableValue'] : $row['defaultValue'];
+                       $variableName = $row['variableName'];
+                       $this->variables[$variableName] = (isset($row['variableValue'])) ? $row['variableValue'] : $row['defaultValue'];
+                       
+                       // provide an empty value for LESS-compiler
+                       if (empty($this->variables[$variableName])) {
+                               $this->variables[$variableName] = "~''";
+                       }
                }
        }