From: Craig Andrews Date: Fri, 22 Jan 2010 15:12:26 +0000 (-0500) Subject: Updated some references to the long gnone "isEnclosure" function to the new "getEnclo... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8a3f27ac9102029f7c8b8eb44431e1df4d82a9b9;p=quix0rs-gnu-social.git Updated some references to the long gnone "isEnclosure" function to the new "getEnclosure" --- diff --git a/classes/File.php b/classes/File.php index 91b12d2e28..189e04ce02 100644 --- a/classes/File.php +++ b/classes/File.php @@ -279,6 +279,8 @@ class File extends Memcached_DataObject if($oembed->modified) $enclosure->modified=$oembed->modified; unset($oembed->size); } + } else { + return false; } } } diff --git a/lib/apiaction.php b/lib/apiaction.php index 2af150ab99..f7b4ef473e 100644 --- a/lib/apiaction.php +++ b/lib/apiaction.php @@ -289,11 +289,12 @@ class ApiAction extends Action $twitter_status['attachments'] = array(); foreach ($attachments as $attachment) { - if ($attachment->isEnclosure()) { + $enclosure_o=$attachment->getEnclosure(); + if ($attachment_enclosure) { $enclosure = array(); - $enclosure['url'] = $attachment->url; - $enclosure['mimetype'] = $attachment->mimetype; - $enclosure['size'] = $attachment->size; + $enclosure['url'] = $enclosure_o->url; + $enclosure['mimetype'] = $enclosure_o->mimetype; + $enclosure['size'] = $enclosure_o->size; $twitter_status['attachments'][] = $enclosure; } } diff --git a/lib/util.php b/lib/util.php index f793cc10e9..77a332b5ec 100644 --- a/lib/util.php +++ b/lib/util.php @@ -731,20 +731,13 @@ function common_linkify($url) { } if (!empty($f)) { - if ($f->isEnclosure()) { + if ($f->getEnclosure()) { $is_attachment = true; $attachment_id = $f->id; - } 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; - - $thumb = File_thumbnail::staticGet('file_id', $f->id); - if (!empty($thumb)) { - $has_thumb = true; - } + + $thumb = File_thumbnail::staticGet('file_id', $f->id); + if (!empty($thumb)) { + $has_thumb = true; } } }