[BUGFIX] Correctly parse displayCond FIELD value with colons 36/51836/3
authorClaus Due <claus@namelesscoder.net>
Fri, 24 Feb 2017 16:59:09 +0000 (17:59 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 28 Feb 2017 18:09:15 +0000 (19:09 +0100)
This patch prevents exploding match texts which contain
colons before matching the value against the field value.

Change-Id: Iebaf8f4cc440b1d5a07467b6947d7880d0dc9f81
Resolves: #79981
Releases: master
Reviewed-on: https://review.typo3.org/51836
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/Form/FormDataProvider/EvaluateDisplayConditions.php
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/EvaluateDisplayConditionsTest.php

index 59df135..ebfc873 100644 (file)
@@ -258,7 +258,7 @@ class EvaluateDisplayConditions implements FormDataProviderInterface
      */
     protected function parseSingleConditionString(string $conditionString, array $databaseRow, array $flexContext = []): array
     {
-        $conditionArray = GeneralUtility::trimExplode(':', $conditionString);
+        $conditionArray = GeneralUtility::trimExplode(':', $conditionString, false, 4);
         $namedConditionArray = [
             'type' => $conditionArray[0],
         ];
index 9c8a023..c4a6002 100644 (file)
@@ -3603,6 +3603,11 @@ class EvaluateDisplayConditionsTest extends \TYPO3\TestingFramework\Core\Unit\Un
                 ['uid' => '23'],
                 false,
             ],
+            'Field value containing colons' => [
+                'FIELD:foo:=:x:y:z',
+                ['foo' => 'x:y:z'],
+                true,
+            ],
             'New is TRUE for new comparison with TRUE' => [
                 'REC:NEW:TRUE',
                 ['uid' => null],