Avoid marking files as attachments that are not locally uploaded, unless they're really oembedable. HTML-y things now excluded properly.

This commit is contained in:
Brion Vibber 2010-11-08 13:27:54 -08:00
parent 719b480eaa
commit 883f7a6c0b
2 changed files with 4 additions and 1 deletions

View File

@ -352,6 +352,9 @@ class File extends Memcached_DataObject
$mimetype = substr($mimetype,0,$semicolon); $mimetype = substr($mimetype,0,$semicolon);
} }
if(in_array($mimetype,$notEnclosureMimeTypes)){ if(in_array($mimetype,$notEnclosureMimeTypes)){
// Never treat HTML as an enclosure type!
return false;
} else {
$oembed = File_oembed::staticGet('file_id',$this->id); $oembed = File_oembed::staticGet('file_id',$this->id);
if($oembed){ if($oembed){
$mimetype = strtolower($oembed->mimetype); $mimetype = strtolower($oembed->mimetype);

View File

@ -877,7 +877,7 @@ function common_linkify($url) {
} }
if (!empty($f)) { if (!empty($f)) {
if ($f->getEnclosure() || File_oembed::staticGet('file_id',$f->id)) { if ($f->getEnclosure()) {
$is_attachment = true; $is_attachment = true;
$attachment_id = $f->id; $attachment_id = $f->id;