Copy isset($attachment->filename) fix from RSS 1.0 to RSS 2.0 and Atom 1.0 feeds.
This commit is contained in:
parent
ae2bc6a850
commit
38784141d1
@ -1170,6 +1170,7 @@ class Notice extends Memcached_DataObject
|
||||
$attachments = $this->attachments();
|
||||
if($attachments){
|
||||
foreach($attachments as $attachment){
|
||||
if (isset($attachment->filename)) {
|
||||
$attributes = array('rel'=>'enclosure','href'=>$attachment->url,'type'=>$attachment->mimetype,'length'=>$attachment->size);
|
||||
if($attachment->title){
|
||||
$attributes['title']=$attachment->title;
|
||||
@ -1177,6 +1178,7 @@ class Notice extends Memcached_DataObject
|
||||
$xs->element('link', $attributes, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$xs->elementEnd('entry');
|
||||
|
||||
|
@ -218,6 +218,7 @@ class TwitterapiAction extends Action
|
||||
if($attachments){
|
||||
$entry['enclosures']=array();
|
||||
foreach($attachments as $attachment){
|
||||
if (isset($attachment->filename)) {
|
||||
$enclosure=array();
|
||||
$enclosure['url']=$attachment->url;
|
||||
$enclosure['mimetype']=$attachment->mimetype;
|
||||
@ -225,6 +226,7 @@ class TwitterapiAction extends Action
|
||||
$entry['enclosures'][]=$enclosure;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# RSS Item specific
|
||||
$entry['description'] = $entry['content'];
|
||||
|
Loading…
Reference in New Issue
Block a user