[BUGFIX] Fix parseUserFuncArguments to respect 0 as argument 18/41218/2
authorSascha Egerer <sascha@sascha-egerer.de>
Tue, 14 Jul 2015 15:54:41 +0000 (17:54 +0200)
committerBenjamin Mack <benni@typo3.org>
Tue, 14 Jul 2015 17:18:57 +0000 (19:18 +0200)
"0" must be an valid "last argument" value in the parseUserFuncArguments
method.

The implementation of the argument iteration must strictly check if
the arguments string is empty.

Change-Id: I8cee20a48030ea9163f55723d9027f39c43e5e1c
Resolves: #68132
Related: #61256
Releases: master, 6.2
Reviewed-on: http://review.typo3.org/41218
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/sysext/core/Classes/Configuration/TypoScript/ConditionMatching/AbstractConditionMatcher.php

index d5078b4..206f705 100644 (file)
@@ -469,7 +469,7 @@ abstract class AbstractConditionMatcher {
        protected function parseUserFuncArguments($arguments) {
                $result = array();
                $arguments = trim($arguments);
-               while ($arguments) {
+               while ($arguments !== '') {
                        if ($arguments[0] === ',') {
                                $result[] = '';
                                $arguments = substr($arguments, 1);