diff --git a/typo3/sysext/backend/Tests/Unit/Configuration/TypoScript/ConditionMatching/ConditionMatcherTest.php b/typo3/sysext/backend/Tests/Unit/Configuration/TypoScript/ConditionMatching/ConditionMatcherTest.php index 4e997d1c06fd..03c1957d6dad 100644 --- a/typo3/sysext/backend/Tests/Unit/Configuration/TypoScript/ConditionMatching/ConditionMatcherTest.php +++ b/typo3/sysext/backend/Tests/Unit/Configuration/TypoScript/ConditionMatching/ConditionMatcherTest.php @@ -272,6 +272,8 @@ public function globalVarConditionMatchesOnEqualExpression() $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 = 10.1]'), '2'); $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 == 10]'), '3'); $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 == 10.1]'), '4'); + $this->assertTrue($this->matchCondition->match('[globalVar = LIT:0 = 0]'), '5'); + $this->assertTrue($this->matchCondition->match('[globalVar = LIT:0 == 0]'), '6'); } /** @@ -300,6 +302,7 @@ public function globalVarConditionMatchesOnNotEqualExpression() { $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 != 20]')); $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 != 10.2]')); + $this->assertTrue($this->matchCondition->match('[globalVar = LIT:0 != 1]')); } /** @@ -332,6 +335,7 @@ public function globalVarConditionMatchesOnLowerThanExpression() { $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 < 20]')); $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 < 10.2]')); + $this->assertTrue($this->matchCondition->match('[globalVar = LIT:0 < 1]')); } /** @@ -356,6 +360,7 @@ public function globalVarConditionMatchesOnGreaterThanExpression() { $this->assertTrue($this->matchCondition->match('[globalVar = LIT:20 > 10]')); $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.2 > 10.1]')); + $this->assertTrue($this->matchCondition->match('[globalVar = LIT:1 > 0]')); } /** diff --git a/typo3/sysext/core/Classes/Configuration/TypoScript/ConditionMatching/AbstractConditionMatcher.php b/typo3/sysext/core/Classes/Configuration/TypoScript/ConditionMatching/AbstractConditionMatcher.php index 633a7de27cb0..b5bb508f50c8 100644 --- a/typo3/sysext/core/Classes/Configuration/TypoScript/ConditionMatching/AbstractConditionMatcher.php +++ b/typo3/sysext/core/Classes/Configuration/TypoScript/ConditionMatching/AbstractConditionMatcher.php @@ -434,13 +434,16 @@ protected function parseUserFuncArguments($arguments) protected function getVariableCommon(array $vars) { $value = null; + $namespace = trim($vars[0]); if (count($vars) === 1) { $value = $this->getGlobal($vars[0]); + } elseif ($namespace === 'LIT') { + $value = trim($vars[1]); } else { $splitAgain = explode('|', $vars[1], 2); $k = trim($splitAgain[0]); if ($k) { - switch ((string)trim($vars[0])) { + switch ($namespace) { case 'GP': $value = GeneralUtility::_GP($k); break; @@ -453,9 +456,6 @@ protected function getVariableCommon(array $vars) case 'IENV': $value = GeneralUtility::getIndpEnv($k); break; - case 'LIT': - return trim($vars[1]); - break; default: return null; }