diff options
author | Craig Andrews <candrews@integralblue.com> | 2010-01-22 10:12:26 -0500 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2010-03-02 14:25:06 -0800 |
commit | c30f95c55cb4fcdde53c0549335d29ed6849cf95 (patch) | |
tree | 567a5fb3431890a69da31bfbf4a79c56d37dbeec | |
parent | e9c127ddd869f44eafe7ae6b30d9dc69df8b863c (diff) |
Updated some references to the long gnone "isEnclosure" function to the new "getEnclosure"
-rw-r--r-- | classes/File.php | 2 | ||||
-rw-r--r-- | lib/apiaction.php | 9 | ||||
-rw-r--r-- | lib/util.php | 17 |
3 files changed, 12 insertions, 16 deletions
diff --git a/classes/File.php b/classes/File.php index 91b12d2e2..189e04ce0 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 8049c0901..f71432e03 100644 --- a/lib/apiaction.php +++ b/lib/apiaction.php @@ -291,11 +291,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 439db581a..add1b0ae6 100644 --- a/lib/util.php +++ b/lib/util.php @@ -770,20 +770,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; } } } |