[BUGFIX] Calculations in GIFBUILDER properties using stdWrap fail 39/42639/2
authorDan Untenzu <mail@pixelbrackets.de>
Mon, 21 Oct 2013 12:13:39 +0000 (14:13 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Sat, 15 Aug 2015 10:55:24 +0000 (12:55 +0200)
Unset each existing TypoScript subarray of all properties
with calculations (offset,dimensions,set,…) in GIFBUILDER.
Do this to prevent the double execution of stdWrap,
which would cause those properties to return uncalculated
and therefore wrong values afterwards.

Resolves: #53002
Releases: master, 6.2
Change-Id: Ib9a6ede30988acad25df8fcca811475c19e77b09
Reviewed-on: http://review.typo3.org/42639
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/frontend/Classes/Imaging/GifBuilder.php

index 9d5418d..e846bd7 100644 (file)
@@ -269,6 +269,7 @@ class GifBuilder extends \TYPO3\CMS\Core\Imaging\GraphicalFunctions {
                                                case 'IMAGE':
                                                        if (isset($this->setup[$theKey . '.']['offset.'])) {
                                                                $this->setup[$theKey . '.']['offset'] = $this->cObj->stdWrap($this->setup[$theKey . '.']['offset'], $this->setup[$theKey . '.']['offset.']);
+                                                               unset($this->setup[$theKey . '.']['offset.']);
                                                        }
                                                        if ($this->setup[$theKey . '.']['offset']) {
                                                                $this->setup[$theKey . '.']['offset'] = $this->calcOffset($this->setup[$theKey . '.']['offset']);
@@ -279,6 +280,7 @@ class GifBuilder extends \TYPO3\CMS\Core\Imaging\GraphicalFunctions {
                                                case 'ELLIPSE':
                                                        if (isset($this->setup[$theKey . '.']['dimensions.'])) {
                                                                $this->setup[$theKey . '.']['dimensions'] = $this->cObj->stdWrap($this->setup[$theKey . '.']['dimensions'], $this->setup[$theKey . '.']['dimensions.']);
+                                                               unset($this->setup[$theKey . '.']['dimensions.']);
                                                        }
                                                        if ($this->setup[$theKey . '.']['dimensions']) {
                                                                $this->setup[$theKey . '.']['dimensions'] = $this->calcOffset($this->setup[$theKey . '.']['dimensions']);
@@ -287,6 +289,7 @@ class GifBuilder extends \TYPO3\CMS\Core\Imaging\GraphicalFunctions {
                                                case 'WORKAREA':
                                                        if (isset($this->setup[$theKey . '.']['set.'])) {
                                                                $this->setup[$theKey . '.']['set'] = $this->cObj->stdWrap($this->setup[$theKey . '.']['set'], $this->setup[$theKey . '.']['set.']);
+                                                               unset($this->setup[$theKey . '.']['set.']);
                                                        }
                                                        if ($this->setup[$theKey . '.']['set']) {
                                                                $this->setup[$theKey . '.']['set'] = $this->calcOffset($this->setup[$theKey . '.']['set']);
@@ -295,6 +298,7 @@ class GifBuilder extends \TYPO3\CMS\Core\Imaging\GraphicalFunctions {
                                                case 'CROP':
                                                        if (isset($this->setup[$theKey . '.']['crop.'])) {
                                                                $this->setup[$theKey . '.']['crop'] = $this->cObj->stdWrap($this->setup[$theKey . '.']['crop'], $this->setup[$theKey . '.']['crop.']);
+                                                               unset($this->setup[$theKey . '.']['crop.']);
                                                        }
                                                        if ($this->setup[$theKey . '.']['crop']) {
                                                                $this->setup[$theKey . '.']['crop'] = $this->calcOffset($this->setup[$theKey . '.']['crop']);
@@ -303,12 +307,14 @@ class GifBuilder extends \TYPO3\CMS\Core\Imaging\GraphicalFunctions {
                                                case 'SCALE':
                                                        if (isset($this->setup[$theKey . '.']['width.'])) {
                                                                $this->setup[$theKey . '.']['width'] = $this->cObj->stdWrap($this->setup[$theKey . '.']['width'], $this->setup[$theKey . '.']['width.']);
+                                                               unset($this->setup[$theKey . '.']['width.']);
                                                        }
                                                        if ($this->setup[$theKey . '.']['width']) {
                                                                $this->setup[$theKey . '.']['width'] = $this->calcOffset($this->setup[$theKey . '.']['width']);
                                                        }
                                                        if (isset($this->setup[$theKey . '.']['height.'])) {
                                                                $this->setup[$theKey . '.']['height'] = $this->cObj->stdWrap($this->setup[$theKey . '.']['height'], $this->setup[$theKey . '.']['height.']);
+                                                               unset($this->setup[$theKey . '.']['height.']);
                                                        }
                                                        if ($this->setup[$theKey . '.']['height']) {
                                                                $this->setup[$theKey . '.']['height'] = $this->calcOffset($this->setup[$theKey . '.']['height']);