summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--classes/Notice.php10
-rw-r--r--lib/twitterapi.php12
2 files changed, 13 insertions, 9 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index 75044cf63..fc28f3558 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -1170,11 +1170,13 @@ class Notice extends Memcached_DataObject
$attachments = $this->attachments();
if($attachments){
foreach($attachments as $attachment){
- $attributes = array('rel'=>'enclosure','href'=>$attachment->url,'type'=>$attachment->mimetype,'length'=>$attachment->size);
- if($attachment->title){
- $attributes['title']=$attachment->title;
+ if (isset($attachment->filename)) {
+ $attributes = array('rel'=>'enclosure','href'=>$attachment->url,'type'=>$attachment->mimetype,'length'=>$attachment->size);
+ if($attachment->title){
+ $attributes['title']=$attachment->title;
+ }
+ $xs->element('link', $attributes, null);
}
- $xs->element('link', $attributes, null);
}
}
diff --git a/lib/twitterapi.php b/lib/twitterapi.php
index 4f3a5c0b6..ce188e00d 100644
--- a/lib/twitterapi.php
+++ b/lib/twitterapi.php
@@ -218,11 +218,13 @@ class TwitterapiAction extends Action
if($attachments){
$entry['enclosures']=array();
foreach($attachments as $attachment){
- $enclosure=array();
- $enclosure['url']=$attachment->url;
- $enclosure['mimetype']=$attachment->mimetype;
- $enclosure['size']=$attachment->size;
- $entry['enclosures'][]=$enclosure;
+ if (isset($attachment->filename)) {
+ $enclosure=array();
+ $enclosure['url']=$attachment->url;
+ $enclosure['mimetype']=$attachment->mimetype;
+ $enclosure['size']=$attachment->size;
+ $entry['enclosures'][]=$enclosure;
+ }
}
}