From 6252381a2f8c1de374a2ad35d20bc10393d6f47a Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Tue, 1 Mar 2016 19:50:17 -0500 Subject: Add garbage collection logic to Object::delObj() Now, on deletion of objects, all refs to it are purged from the xref tables, obj_member and msg_read --- app/class/object.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/class/object.class.php b/app/class/object.class.php index 96cc810..bc8a67f 100644 --- a/app/class/object.class.php +++ b/app/class/object.class.php @@ -181,6 +181,14 @@ abstract class Object extends Framework /* Delete Child */ $query = "DELETE FROM `" . $this->childTable . "` WHERE `guid` = '" . $this->db->esc($this->guid) . "'"; $this->db->query($query); + + /* obj_member garbage collection */ + $query = "DELETE FROM `obj_member` WHERE `guid` = '" . $this->db->esc($this->guid) . "' OR `member` = '" . $this->db->esc($this->guid) . "'"; + $this->db->query($query); + + /* msg_read garbage collection */ + $query = "DELETE FROM `msg_read` WHERE `guid` = '" . $this->db->esc($this->guid) . "' OR `user` = '" . $this->db->esc($this->guid) . "'"; + $this->db->query($query); } /* -- cgit v1.2.3