Fix comment
authorjoshuaruesweg <ruesweg@woltlab.com>
Mon, 17 Aug 2020 14:13:25 +0000 (16:13 +0200)
committerjoshuaruesweg <ruesweg@woltlab.com>
Mon, 17 Aug 2020 14:13:25 +0000 (16:13 +0200)
wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php
wcfsetup/install/files/lib/acp/form/StyleEditForm.class.php
wcfsetup/install/files/lib/acp/form/StyleGlobalValuesForm.class.php
wcfsetup/install/files/lib/system/style/StyleCompiler.class.php

index 9368b72da9a2717b17cbf8a40c665e6b9f7119c7..f93d2cc9fb2976079052929c40d9e463b6c52e33 100644 (file)
@@ -474,7 +474,7 @@ class StyleAddForm extends AbstractForm {
                $this->styleTestFileDir = FileUtil::getTemporaryFilename('style_');
                FileUtil::makePath($this->styleTestFileDir);
                
-               $result = StyleCompiler::getInstance()->testStyle($this->styleTestFileDir, $this->apiVersion, false, $variables);
+               $result = StyleCompiler::getInstance()->testStyle($this->styleTestFileDir, $this->styleName, $this->apiVersion, false, $variables);
                
                if ($result !== null) {
                        rmdir($this->styleTestFileDir);
index d07af7be41c4c93c9bda90b49a74cc5057d2e389..2e7b6152a8e5f7e5cf94684bb3b26a6a662e0e0c 100644 (file)
@@ -82,7 +82,7 @@ class StyleEditForm extends StyleAddForm {
                $this->styleTestFileDir = FileUtil::getTemporaryFilename('style_');
                FileUtil::makePath($this->styleTestFileDir);
                
-               $result = StyleCompiler::getInstance()->testStyle($this->styleTestFileDir, $this->apiVersion, $this->style->imagePath, $variables);
+               $result = StyleCompiler::getInstance()->testStyle($this->styleTestFileDir, $this->styleName, $this->apiVersion, $this->style->imagePath, $variables);
                
                if ($result !== null) {
                        rmdir($this->styleTestFileDir);
index 8b644a477a397b8241f0de9cee366e3e5f33ff2b..96094a58031b21f7c6fa54102a4d53a2c284cc69 100644 (file)
@@ -82,7 +82,7 @@ class StyleGlobalValuesForm extends AbstractForm {
                                $this->styleTestFileDir = FileUtil::getTemporaryFilename('style_');
                                FileUtil::makePath($this->styleTestFileDir);
                                
-                               $errorMessage = StyleCompiler::getInstance()->testStyle($this->styleTestFileDir, $defaultStyle->apiVersion, $defaultStyle->imagePath, $defaultStyle->getVariables(), $tmpFile);
+                               $errorMessage = StyleCompiler::getInstance()->testStyle($this->styleTestFileDir, $defaultStyle->styleName, $defaultStyle->apiVersion, $defaultStyle->imagePath, $defaultStyle->getVariables(), $tmpFile);
                                
                                if ($errorMessage !== null) {
                                        rmdir($this->styleTestFileDir);
index 2b6ca94aa8242b757156ac231d3c826d741b2e00..7f9a11e70143255188098f94d8915343afb11b79 100644 (file)
@@ -94,6 +94,7 @@ class StyleCompiler extends SingletonFactory {
         * error, null is returned. Otherwise the exception is returned (!).
         * 
         * @param       string                  $testFileDir
+        * @param       string                  $styleName
         * @param       string                  $apiVersion
         * @param       string                  $imagePath
         * @param       string[]                $variables
@@ -101,7 +102,7 @@ class StyleCompiler extends SingletonFactory {
         * @return      null|\Exception
         * @since       5.3           
         */
-       public function testStyle($testFileDir, $apiVersion, $imagePath, array $variables, $customCustomSCSSFile = null) {
+       public function testStyle($testFileDir, $styleName, $apiVersion, $imagePath, array $variables, $customCustomSCSSFile = null) {
                $individualScss = '';
                if (isset($variables['individualScss'])) {
                        $individualScss = $variables['individualScss'];
@@ -151,8 +152,8 @@ class StyleCompiler extends SingletonFactory {
                                $files,
                                $variables,
                                $individualScss . (!empty($parameters['scss']) ? "\n" . $parameters['scss'] : ''),
-                               function($content) {
-                                       return "/* stylesheet, generated on ".gmdate('r')." -- DO NOT EDIT */\n\n" . $content;
+                               function($content) use ($styleName) {
+                                       return "/* stylesheet for '". $styleName ."', generated on ".gmdate('r')." -- DO NOT EDIT */\n\n" . $content;
                                }
                        );
                }