[BUGFIX] Use strict flag in signalslot dispatcher 89/55189/3
authorGeorg Ringer <georg.ringer@gmail.com>
Thu, 12 Oct 2017 07:03:30 +0000 (09:03 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Sat, 6 Jan 2018 16:21:49 +0000 (17:21 +0100)
To avoid exceptions with complex structures, the strict flag
must be used in the in_array check.

Resolves: #82736
Releases: master, 8.7, 7.6
Change-Id: I3ecf859e3e3cc70ab40b10ef9052d46e8b486957
Reviewed-on: https://review.typo3.org/55189
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/extbase/Classes/SignalSlot/Dispatcher.php

index 5974bf7..2bb1454 100644 (file)
@@ -93,7 +93,9 @@ class Dispatcher implements \TYPO3\CMS\Core\SingletonInterface
             'object' => $object,
             'passSignalInformation' => $passSignalInformation === true
         ];
-        if (!is_array($this->slots[$signalClassName][$signalName]) || !in_array($slot, $this->slots[$signalClassName][$signalName])) {
+        // The in_array() comparision needs to be strict to avoid potential issues
+        // with complex objects being registered as slot.
+        if (!is_array($this->slots[$signalClassName][$signalName]) || !in_array($slot, $this->slots[$signalClassName][$signalName], true)) {
             $this->slots[$signalClassName][$signalName][] = $slot;
         }
     }