]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Avoid marking files as attachments that are not locally uploaded, unless they're...
authorBrion Vibber <brion@status.net>
Mon, 8 Nov 2010 21:27:54 +0000 (13:27 -0800)
committerBrion Vibber <brion@status.net>
Mon, 8 Nov 2010 21:27:54 +0000 (13:27 -0800)
classes/File.php
lib/util.php

index 16e00024a5f5874481be919e3fcdb5087a3a7644..d71403e64905527b4fd6b418acc32ae607c6b156 100644 (file)
@@ -352,6 +352,9 @@ class File extends Memcached_DataObject
                 $mimetype = substr($mimetype,0,$semicolon);
             }
             if(in_array($mimetype,$notEnclosureMimeTypes)){
+                // Never treat HTML as an enclosure type!
+                return false;
+            } else {
                 $oembed = File_oembed::staticGet('file_id',$this->id);
                 if($oembed){
                     $mimetype = strtolower($oembed->mimetype);
index 8f2a9f17389d4460a188ca892deb5752e041df5e..e6b62f750f18adb9dee887247cf0c8714fdc3469 100644 (file)
@@ -877,7 +877,7 @@ function common_linkify($url) {
     }
 
     if (!empty($f)) {
-        if ($f->getEnclosure() || File_oembed::staticGet('file_id',$f->id)) {
+        if ($f->getEnclosure()) {
             $is_attachment = true;
             $attachment_id = $f->id;