]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/attachmentlist.php
FeedList widget had mismatching show() definition
[quix0rs-gnu-social.git] / lib / attachmentlist.php
index 6609cb40daecc66c64492d02bcbf7338b3772d4d..d6cfda6f95961b4f3bd74be7a1a52d384df947bc 100644 (file)
@@ -74,18 +74,28 @@ class AttachmentList extends Widget
      */
     function show()
     {
-       $att = $this->notice->attachments();
-        if (empty($att)) return 0;
+       $attachments = $this->notice->attachments();
+        $representable = false;
+        foreach ($attachments as $key=>$att) {
+            // Only show attachments representable with a title
+            if ($att->getTitle() === null) {
+                unset($attachments[$key]);
+            }
+        }
+        if (!count($attachments)) {
+            return 0;
+        }
+
         $this->showListStart();
 
-        foreach ($att as $n=>$attachment) {
-            $item = $this->newListItem($attachment);
+        foreach ($attachments as $att) {
+            $item = $this->newListItem($att);
             $item->show();
         }
 
         $this->showListEnd();
 
-        return count($att);
+        return count($attachments);
     }
 
     function showListStart()