Changeset 1058

Show
Ignore:
Timestamp:
07/06/06 21:42:22
Author:
miyagawa
Message:

Use 1st enclosure with URL defined for RSS 2.0. Refs #325

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/Publish/Feed.pm

    r753 r1058  
    6060 
    6161        if ($e->has_enclosure) { 
    62             # RSS 2.0 by spec doesn't allow multiple enclosures 
    63             my @enclosures = $feed_format eq 'RSS' ? ($e->enclosures->[0]) : $e->enclosures; 
    64             for my $enclosure (grep { defined $_->url && !$_->is_inline } @enclosures) { 
     62            for my $enclosure ($e->enclosures) { 
    6563                $entry->add_enclosure({ 
    6664                    url    => $enclosure->url, 
     
    6866                    type   => $enclosure->type, 
    6967                }); 
     68 
     69                # RSS 2.0 by spec doesn't allow multiple enclosures 
     70                last if $feed_format eq 'RSS'; 
    7071            } 
    7172        }