]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Item.php
Fix notice in Item::deleteById
[friendica.git] / src / Model / Item.php
index 5d858fa72b0cdf436651ee2df6d0cdbe4a59e9c2..052d402127cc7338ac54003b039f523fb4d12307 100644 (file)
@@ -801,7 +801,9 @@ class Item extends BaseObject
                // If item has attachments, drop them
                foreach (explode(", ", $item['attach']) as $attach) {
                        preg_match("|attach/(\d+)|", $attach, $matches);
-                       dba::delete('attach', ['id' => $matches[1], 'uid' => $item['uid']]);
+                       if (is_array($matches) && count($matches) > 1) {
+                               dba::delete('attach', ['id' => $matches[1], 'uid' => $item['uid']]);
+                       }
                }
 
                // Delete tags that had been attached to other items