Skip to content

Commit

Permalink
[BUGFIX] Fix another PHP 8 warning in DataHandler
Browse files Browse the repository at this point in the history
Resolves: #102134
Releases: main, 12.4, 11.5
Change-Id: I3aaf6f2c8161579394a0dbe1c9f470edeb0a8bca
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81398
Reviewed-by: Stefan Bürk <[email protected]>
Reviewed-by: Oliver Klee <[email protected]>
Reviewed-by: Simon Schaufelberger <[email protected]>
Tested-by: Simon Schaufelberger <[email protected]>
Reviewed-by: Christian Kuhn <[email protected]>
Tested-by: Oliver Klee <[email protected]>
Tested-by: Stefan Bürk <[email protected]>
Tested-by: Christian Kuhn <[email protected]>
Tested-by: core-ci <[email protected]>
  • Loading branch information
Philipp Kitzberger authored and sbuerk committed Oct 15, 2023
1 parent a646ee8 commit 4707456
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion typo3/sysext/core/Classes/DataHandling/DataHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -7764,8 +7764,11 @@ public function insertDB($table, $id, $fieldArray, $newVersion = false, $suggest
// This feature is used by the import functionality to force a new record to have a certain UID value.
// This is only recommended for use when the destination server is a passive mirror of another server.
// As a security measure this feature is available only for Admin Users (for now)
// The value of $this->suggestedInsertUids["table":"uid"] is either string 'DELETE' (ext:impexp) to trigger
// a blind delete of any possibly existing row before insert with forced uid, or boolean true (testing-framework)
// to only force the uid insert and skipping deletion of an existing row.
$suggestedUid = (int)$suggestedUid;
if ($this->BE_USER->isAdmin() && $suggestedUid && $this->suggestedInsertUids[$table . ':' . $suggestedUid]) {
if ($this->BE_USER->isAdmin() && $suggestedUid && ($this->suggestedInsertUids[$table . ':' . $suggestedUid] ?? false)) {
// When the value of ->suggestedInsertUids[...] is "DELETE" it will try to remove the previous record
if ($this->suggestedInsertUids[$table . ':' . $suggestedUid] === 'DELETE') {
$this->hardDeleteSingleRecord($table, (int)$suggestedUid);
Expand Down

0 comments on commit 4707456

Please sign in to comment.