Fixed variables containing forward slashes breaking the LESS compiler
authorAlexander Ebert <ebert@woltlab.com>
Sat, 24 May 2014 10:48:13 +0000 (12:48 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 24 May 2014 10:48:13 +0000 (12:48 +0200)
wcfsetup/install/files/lib/system/style/StyleCompiler.class.php

index 04a9a1ba6417dbffbde145cee5c1bfca0f556902..c77c813f1b1352c0fa000b5a3221f877fcd60b18 100644 (file)
@@ -191,6 +191,14 @@ class StyleCompiler extends SingletonFactory {
         * @param       \wcf\system\Callback    $callback
         */
        protected function compileStylesheet($filename, array $files, array $variables, $individualLess, Callback $callback) {
+               // escape variable values containing a forward slash
+               foreach ($variables as &$value) {
+                       if (strpos($value, '/') !== false) {
+                               $value = '~"'.$value.'"';
+                       }
+               }
+               unset($value);
+               
                // add options as LESS variables
                if (PACKAGE_ID) {
                        foreach (Option::getOptions() as $constantName => $option) {