diff options
author | Zach Copley <zach@controlyourself.ca> | 2009-07-09 11:28:21 -0700 |
---|---|---|
committer | Zach Copley <zach@controlyourself.ca> | 2009-07-09 11:28:21 -0700 |
commit | db587562756483ec285b274adc073df29d4031ae (patch) | |
tree | e4ac812d424e223eb8ce25490262996ae7cb7d9a /classes | |
parent | c981f5bcec02295482153e45b0d57f37260706c0 (diff) | |
parent | 69574591d0ac429475b1099e8d9f3e46f7a004ea (diff) |
Merge branch 'candrews-review' into 0.8.x
* candrews-review:
Notice attachments are enclosures in feeds (Atom, RSS 1.0/RDF, and RSS 2.0).
Diffstat (limited to 'classes')
-rw-r--r-- | classes/Notice.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/classes/Notice.php b/classes/Notice.php index 5ec0692d9..e975cab93 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -1164,6 +1164,18 @@ class Notice extends Memcached_DataObject } $tag->free(); + # Enclosures + $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; + } + $xs->element('link', $attributes, null); + } + } + $xs->elementEnd('entry'); return $xs->getString(); |