[BUGFIX] Chained stdWrap is broken for boolean stdWrap function types
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Fri, 15 Jul 2011 12:52:33 +0000 (14:52 +0200)
committerXavier Perseguers <typo3@perseguers.ch>
Sun, 24 Jul 2011 10:22:21 +0000 (12:22 +0200)
isExecuted was not correctly set and so stdWrap was
actually called twice.

Thanks to Jo Hasenau.

Change-Id: I69855b88d5f2f782d99e78fe6dc83c3ac6373ff7
Resolves: #28234
Releases: 4.5, 4.6
Reviewed-on: http://review.typo3.org/3698
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
typo3/sysext/cms/tslib/class.tslib_content.php

index 32c05a4..82ccf6d 100644 (file)
@@ -2039,7 +2039,7 @@ class tslib_cObj {
                                        }
                                        // check if key is still containing something, since it might have been changed by next level stdWrap before
                                        if ((isset($conf[$functionName]) || $conf[$functionProperties]) &&
-                                                       !($functionType == 'boolean' && $conf[$functionName] === '0')) {
+                                                       !($functionType == 'boolean' && !$conf[$functionName])) {
                                                //add both keys - with and without the dot - to the set of executed functions
                                                $isExecuted[$functionName] = true;
                                                $isExecuted[$functionProperties] = true;
@@ -2049,6 +2049,10 @@ class tslib_cObj {
                                                        $content,
                                                        $singleConf
                                                );
+                                       // for booleans we have to mark the function as executed in any case, even if it has been 0, '' or false to avoid a second call based on the functionProperties, which would always be true
+                                       } elseif($functionType == 'boolean' && !$conf[$functionName]) {
+                                               $isExecuted[$functionName] = TRUE;
+                                               $isExecuted[$functionProperties] = TRUE;
                                        }
                                }
                        }