[BUGFIX] Early return in checkValueForInternalReferences 17/53417/2
authorThomas Hohn <thomas@hohn.dk>
Tue, 20 Jun 2017 09:31:18 +0000 (11:31 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Thu, 6 Jul 2017 12:18:32 +0000 (14:18 +0200)
If an empty field is passed to checkValueForInternalReferences
in the DataHandler class - there is no need to process the
field since it's not a "real" DB field.

An early return ensures that the method is not executed
unnecessarily and for Flexforms.

Resolves: #81627
Releases: master, 8.7
Change-Id: I1143e586d80faf8d45acb54d5937175950c8e403
Reviewed-on: https://review.typo3.org/53417
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/core/Classes/DataHandling/DataHandler.php

index 619135e..c0c6afb 100644 (file)
@@ -1711,8 +1711,10 @@ class DataHandler
         ];
 
         if (
+            // in case field is empty
+            empty($field)
             // in case the field is not relevant
-            !in_array($field, $relevantFieldNames)
+            || !in_array($field, $relevantFieldNames)
             // in case the 'value' index has been unset already
             || !array_key_exists('value', $res)
             // in case it's not a NEW-identifier