From: Alexander Ebert Date: Sat, 10 Aug 2013 12:20:54 +0000 (+0200) Subject: Fixed overridden variables being persistent X-Git-Tag: 2.0.0_Beta_7~31^2~8 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d409e4fa81165708ffa600ee68715627a7936b14;p=GitHub%2FWoltLab%2FWCF.git Fixed overridden variables being persistent Fixes #1450 --- diff --git a/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php b/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php index d5614cc740..b2043d1a41 100644 --- a/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php @@ -332,9 +332,6 @@ class StyleAddForm extends AbstractForm { 'text' => $matches[1] ); } - else { - $this->variables[$matches[1]] = $matches[2]; - } } else { // not valid diff --git a/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php b/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php index fa5c052a63..25d19ac05d 100644 --- a/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php +++ b/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php @@ -7,6 +7,7 @@ use wcf\system\Callback; use wcf\system\SingletonFactory; use wcf\system\WCF; use wcf\util\FileUtil; +use wcf\util\StringUtil; use wcf\util\StyleUtil; /** @@ -65,6 +66,17 @@ class StyleCompiler extends SingletonFactory { unset($variables['individualLess']); } + // apply overrides + if (isset($variables['overrideLess'])) { + $lines = explode("\n", StringUtil::unifyNewlines($variables['overrideLess'])); + foreach ($lines as $line) { + if (preg_match('~^@([a-zA-Z]+): ?([@a-zA-Z0-9 ,\.\(\)\%\#-]+);$~', $line, $matches)) { + $variables[$matches[1]] = $matches[2]; + } + } + unset($variables['overrideLess']); + } + $this->compileStylesheet( WCF_DIR.'style/style-'.$style->styleID, $files,