diff --git a/library/Icinga/Less/Call.php b/library/Icinga/Less/Call.php index 0e6074dbe..449ede622 100644 --- a/library/Icinga/Less/Call.php +++ b/library/Icinga/Less/Call.php @@ -1,5 +1,7 @@ value[0] = $vr; + break; } } diff --git a/library/Icinga/Less/ColorProp.php b/library/Icinga/Less/ColorProp.php index b6fe6d2e2..3f83c5eee 100644 --- a/library/Icinga/Less/ColorProp.php +++ b/library/Icinga/Less/ColorProp.php @@ -1,5 +1,5 @@ evaluating) { + if ($this->evaluating) { // Just like the parent method throw new Less_Exception_Compiler( "Recursive variable definition for " . $this->name, null, diff --git a/library/Icinga/Less/LightMode.php b/library/Icinga/Less/LightMode.php index 30197614a..7bdf6f575 100644 --- a/library/Icinga/Less/LightMode.php +++ b/library/Icinga/Less/LightMode.php @@ -1,5 +1,5 @@ name === 'var') { - if ($this->callingVar !== false) { - throw new LogicException('Already calling var'); - } - - $this->callingVar = spl_object_hash($c); - } else { + if ($c->name !== 'var') { // We need to use our own tree call class , so that we can precompile the arguments before making // the actual LESS function calls. Otherwise, it will produce lots of invalid argument exceptions! $c = Call::fromCall($c); @@ -80,13 +74,6 @@ CSS; return $c; } - public function visitCallOut($c) - { - if ($this->callingVar !== false && $this->callingVar === spl_object_hash($c)) { - $this->callingVar = false; - } - } - public function visitDetachedRuleset($drs) { if ($this->variableOrigin->name === '@' . static::LIGHT_MODE_NAME) { @@ -194,7 +181,7 @@ CSS; public function visitVariable($v) { - if ($this->callingVar !== false || $this->definingVariable !== false) { + if ($this->definingVariable !== false) { return $v; } @@ -205,6 +192,7 @@ CSS; public function visitColor($c) { if ($this->definingVariable !== false) { + // Make sure that all less tree colors do have a proper name $c->name = $this->variableOrigin->name; }