Skip to content

Commit

Permalink
[BUGFIX] Disallow pasting element inside it self (endless loop)
Browse files Browse the repository at this point in the history
  • Loading branch information
xf- committed Jul 26, 2015
1 parent bc15218 commit 3772556
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Classes/Service/ContentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ public function pasteAfter($command, array &$row, $parameters, DataHandler $tceM
// Parameters were passed in a hyphen-glued string, created by Flux and passed into command.
list ($pid, $subCommand, $relativeUid, $parentUid, $possibleArea, $possibleColPos) = explode('-', $parameters[1]);
$parentUid = (integer) $parentUid;
// Parent into same grid results in endless loop
if ('move' === $command && (integer) $id === $parentUid && (integer) $pid === (integer) $row['pid']) {
return;
}
$relativeUid = 0 - (integer) $relativeUid;
if (FALSE === empty($possibleArea)) {
// Flux content area detected, override colPos to virtual Flux column number.
Expand Down

0 comments on commit 3772556

Please sign in to comment.