[BUGFIX] Early return in checkValueForInternalReferences 72/53272/3
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 11:48:21 +0000 (13:48 +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/53272
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christer V <cvi@systime.dk>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Kasper Ligaard <kasperligaard+typo3.org@gmail.com>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Kasper Ligaard <kasperligaard+typo3.org@gmail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>

index 99f0525..45f8308 100644 (file)
@@ -1690,8 +1690,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