]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Re-use enclosure decision logic to decide if a link gets a paperclip/lightbox popup.
authorCraig Andrews <candrews@integralblue.com>
Fri, 11 Sep 2009 01:13:30 +0000 (21:13 -0400)
committerCraig Andrews <candrews@integralblue.com>
Fri, 11 Sep 2009 01:13:30 +0000 (21:13 -0400)
lib/util.php

index 256acf1993bbf8bb84d7ca077959b720171040e2..292045928dddc5d791faf22c030e984c856db618 100644 (file)
@@ -552,12 +552,13 @@ function common_linkify($url) {
     }
 
     if (!empty($f)) {
-        if (isset($f->filename)) {
+        if ($f->isEnclosure()) {
             $is_attachment = true;
             $attachment_id = $f->id;
-        } else { // if it has OEmbed info, it's an attachment, too
+        } else {
             $foe = File_oembed::staticGet('file_id', $f->id);
             if (!empty($foe)) {
+                // if it has OEmbed info, it's an attachment, too
                 $is_attachment = true;
                 $attachment_id = $f->id;