[BUGFIX] Avoid remapping empty value in checkValueForInline 71/52171/2
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:13:01 +0000 (10:13 +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
Reviewed-on: https://review.typo3.org/52171
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/core/Classes/DataHandling/DataHandler.php

index d5e5f80..4223042 100644 (file)
@@ -2667,7 +2667,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[] = [