[BUGFIX] Avoid remapping empty value in checkValueForInline 15/51015/10
authorClaus Due <claus@namelesscoder.net>
Wed, 21 Dec 2016 15:44:14 +0000 (16:44 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Mon, 27 Mar 2017 08:05:41 +0000 (10:05 +0200)
This change prevents checkValueForInline from processing
empty values. The existing check would process empty
values since one of the true matches is when value cannot
be interpreted as an integer.

Change-Id: Iacd38363bcc23453da9fcc2eea359680c6b91175
Resolves: #79063
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/51015
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Thomas Hohn <thomas@hohn.dk>
Tested-by: Thomas Hohn <thomas@hohn.dk>
Reviewed-by: Christer V <cvi@systime.dk>
Reviewed-by: Kasper Ligaard <kasperligaard+typo3.org@gmail.com>
Reviewed-by: Markus Sommer <markussom@posteo.de>
Tested-by: Markus Sommer <markussom@posteo.de>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/core/Classes/DataHandling/DataHandler.php

index c02b9a2..4790f0d 100644 (file)
@@ -2504,7 +2504,7 @@ class DataHandler
         // Example for received data:
         // $value = 45,NEW4555fdf59d154,12,123
         // We need to decide whether we use the stack or can save the relation directly.
-        if (strpos($value, 'NEW') !== false || !MathUtility::canBeInterpretedAsInteger($id)) {
+        if (!empty($value) && (strpos($value, 'NEW') !== false || !MathUtility::canBeInterpretedAsInteger($id))) {
             $this->remapStackRecords[$table][$id] = ['remapStackIndex' => count($this->remapStack)];
             $this->addNewValuesToRemapStackChildIds($valueArray);
             $this->remapStack[] = [