Skip to content
Snippets Groups Projects
Commit c514a836 authored by Patrick Schriner's avatar Patrick Schriner Committed by Markus Klein
Browse files

[BUGFIX] Replace PHP 7.2 deprecated each()

each() is deprecated in PHP 7.2 and has to be replaced.

Resolves: #83321
Releases: master, 8.7, 7.6
Change-Id: Ic318b50a9921cd6a55435cc9b2e0b254e61b9dbc
Reviewed-on: https://review.typo3.org/55064


Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
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 2892f6dc
Branches
Tags
No related merge requests found
......@@ -139,17 +139,22 @@ class ConditionMatcher extends AbstractConditionMatcher
if ($id = (int)GeneralUtility::_GP('id')) {
$pageId = $id;
} elseif (is_array($editStatement)) {
list($table, $uidAndAction) = each($editStatement);
list($uid, $action) = each($uidAndAction);
$table = key($editStatement);
$uidAndAction = current($editStatement);
$uid = key($uidAndAction);
$action = current($uidAndAction);
if ($action === 'edit') {
$pageId = $this->getPageIdByRecord($table, $uid);
} elseif ($action === 'new') {
$pageId = $this->getPageIdByRecord($table, $uid, true);
}
} elseif (is_array($commandStatement)) {
list($table, $uidActionAndTarget) = each($commandStatement);
list($uid, $actionAndTarget) = each($uidActionAndTarget);
list($action, $target) = each($actionAndTarget);
$table = key($commandStatement);
$uidActionAndTarget = current($commandStatement);
$uid = key($uidActionAndTarget);
$actionAndTarget = current($uidActionAndTarget);
$action = key($actionAndTarget);
$target = current($actionAndTarget);
if ($action === 'delete') {
$pageId = $this->getPageIdByRecord($table, $uid);
} elseif ($action === 'copy' || $action === 'move') {
......
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