Put the Google Fonts name in quotes to avoid parsing
authorAlexander Ebert <ebert@woltlab.com>
Thu, 6 Dec 2018 15:27:29 +0000 (16:27 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 6 Dec 2018 15:27:29 +0000 (16:27 +0100)
Replaces d2c3d9659e44dab360eaa505ec92984d0ea0cf81

wcfsetup/install/files/lib/system/style/StyleCompiler.class.php

index 836a205e915eec6cbf8d9bd4f5a9b24bb1173ca7..6c2c3539adc1607e7f02d644cd71168fe27f6ea2 100644 (file)
@@ -311,10 +311,12 @@ class StyleCompiler extends SingletonFactory {
                
                $variables['wcfFontFamily'] = $variables['wcfFontFamilyFallback'];
                if (!empty($variables['wcfFontFamilyGoogle'])) {
-                       $variables['wcfFontFamily'] = '"' . $variables['wcfFontFamilyGoogle'] . '", ' . $variables['wcfFontFamily'];
+                       // The SCSS parser attempts to evaluate the variables, causing issues with font names that
+                       // include logical operators such as "And" or "Or".
+                       $variables['wcfFontFamilyGoogle'] = '"' . $variables['wcfFontFamilyGoogle'] . '"';
+                       
+                       $variables['wcfFontFamily'] = $variables['wcfFontFamilyGoogle'] . ', ' . $variables['wcfFontFamily'];
                }
-               unset($variables['wcfFontFamilyFallback']);
-               unset($variables['wcfFontFamilyGoogle']);
                
                // add options as SCSS variables
                if (PACKAGE_ID) {