[BUGFIX] Fix nested arrays in conditions 35/58935/9
authorWolfgang Klinger <wolfgang@wazum.com>
Fri, 23 Nov 2018 12:23:25 +0000 (13:23 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Fri, 7 Dec 2018 20:19:25 +0000 (21:19 +0100)
commitc443d5cc0f09ba83f48ed4ce246098151fee4c41
tree276b8c390211f2aa48cee45f931873c61e1b96a6
parent1e94de8cbfafa6d4601f42ae5c36cb5df1072e74
[BUGFIX] Fix nested arrays in conditions

The RequestWrapper::getParsedBody method must return an array,
otherwise the a condition like [request.getParsedBody()['foo'] == 1]
results in a silent exception if the body is empty.

ConditionMatcher::normalizeExpression is now using an advanced regex
to handle multiple [] parts correctly.

Resolves: #86915
Releases: master
Change-Id: Ia3f951d1a3994d545025691e35521ca05b97a39a
Reviewed-on: https://review.typo3.org/58935
Tested-by: TYPO3com <no-reply@typo3.com>
Tested-by: Joerg Kummer <typo3@enobe.de>
Reviewed-by: Raphael Graf <r@undefined.ch>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/core/Classes/Configuration/TypoScript/ConditionMatching/AbstractConditionMatcher.php
typo3/sysext/core/Classes/ExpressionLanguage/RequestWrapper.php
typo3/sysext/core/Tests/Unit/Configuration/TypoScript/ConditionMatching/AbstractConditionMatcherTest.php