]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/File.php
File_to_post indexing and cleaning preparations
[quix0rs-gnu-social.git] / classes / File.php
index 242da159c23e5fbb438f4967b4503d1f4dd40bce..1e296242b79f350c610fa327819ed2cfa4ed481a 100644 (file)
@@ -569,6 +569,14 @@ class File extends Managed_DataObject
                     $thumbs->delete();
                 }
             }
+
+            $f2p = new File_to_post();
+            $f2p->file_id = $this->id;
+            if ($f2p->find()) {
+                while ($f2p->fetch()) {
+                    $f2p->delete();
+                }
+            }
         }
 
         // And finally remove the entry from the database