Skip to content
Snippets Groups Projects
Commit e26fcb2a authored by Georg Ringer's avatar Georg Ringer Committed by Markus Klein
Browse files

[BUGFIX] Use strict flag in signalslot dispatcher

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: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: default avatarMarkus Klein <markus.klein@typo3.org>
parent 3d60a51f
Branches
Tags
No related merge requests found
...@@ -93,7 +93,9 @@ class Dispatcher implements \TYPO3\CMS\Core\SingletonInterface ...@@ -93,7 +93,9 @@ class Dispatcher implements \TYPO3\CMS\Core\SingletonInterface
'object' => $object, 'object' => $object,
'passSignalInformation' => $passSignalInformation === true '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; $this->slots[$signalClassName][$signalName][] = $slot;
} }
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment