[BUGFIX] Fix double-stdWrapping of GIFBUILDER's TEXT object 65/16865/3
authorjyps <jwagner@digilog.de>
Mon, 8 Oct 2012 16:23:52 +0000 (18:23 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Sun, 5 May 2013 15:02:22 +0000 (17:02 +0200)
During extensive overhaul of stdWrap from TYPO3 v4.4 to v4.5 a
bug was introduced that led to double-stdWrapping of all
properties of GIFBUILDER's TEXT object.

Change-Id: Ib74fdc9899f3d0ee3f6fc96ffbb9c7dbc3ee01e2
Fixes: #41487
Releases: 6.2, 6.1, 6.0, 4.7, 4.5
Reviewed-on: https://review.typo3.org/16865
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
typo3/sysext/frontend/Classes/Imaging/GifBuilder.php

index 5cffde9..9c2b8e1 100644 (file)
@@ -397,14 +397,20 @@ class GifBuilder extends \TYPO3\CMS\Core\Imaging\GraphicalFunctions {
                        foreach ($sKeyArray as $theKey) {
                                $theValue = $this->setup[$theKey];
                                if (intval($theKey) && ($conf = $this->setup[$theKey . '.'])) {
-                                       $isStdWrapped = array();
-                                       foreach ($conf as $key => $value) {
-                                               $parameter = rtrim($key, '.');
-                                               if (!$isStdWrapped[$parameter] && isset($conf[$parameter . '.'])) {
-                                                       $conf[$parameter] = $this->cObj->stdWrap($conf[$parameter], $conf[$parameter . '.']);
-                                                       $isStdWrapped[$parameter] = 1;
+                                       // apply stdWrap to all properties, except for TEXT objects
+                                       // all properties of the TEXT sub-object have already been stdWrap-ped
+                                       // before in ->checkTextObj()
+                                       if ($theValue !== 'TEXT') {
+                                               $isStdWrapped = array();
+                                               foreach ($conf as $key => $value) {
+                                                       $parameter = rtrim($key, '.');
+                                                       if (!$isStdWrapped[$parameter] && isset($conf[$parameter . '.'])) {
+                                                               $conf[$parameter] = $this->cObj->stdWrap($conf[$parameter], $conf[$parameter . '.']);
+                                                               $isStdWrapped[$parameter] = 1;
+                                                       }
                                                }
                                        }
+
                                        switch ($theValue) {
                                        case 'IMAGE':
                                                if ($conf['mask']) {