aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2011-10-08 22:10:49 -0400
committerCash Costello <cash.costello@gmail.com>2011-10-08 22:10:49 -0400
commit99a8c831f9487f2c99dd6467eb8dc48ea2d54883 (patch)
tree9e4f4befa43c5c559a4b079c9496d491272776d4 /engine/lib
parentba4bbf484d33fe24332ff63ac3b063f346a2a74c (diff)
downloadelgg-99a8c831f9487f2c99dd6467eb8dc48ea2d54883.tar.gz
elgg-99a8c831f9487f2c99dd6467eb8dc48ea2d54883.tar.bz2
Fixes #3897 fixed source of infinite regression loop in delete_entity()
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/entities.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index 78fa915dd..f1352ba8d 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -1507,7 +1507,11 @@ function delete_entity($guid, $recursive = true) {
or site_guid=$guid", 'entity_row_to_elggstar');
if ($sub_entities) {
foreach ($sub_entities as $e) {
- $e->delete(true);
+ // check for equality so that an entity that is its own
+ // owner or container does not cause infinite loop
+ if ($e->guid != $guid) {
+ $e->delete(true);
+ }
}
}