diff --git a/lib/WebGUI/Asset/RSSFromParent.pm b/lib/WebGUI/Asset/RSSFromParent.pm index b570b410b..87651b4b0 100644 --- a/lib/WebGUI/Asset/RSSFromParent.pm +++ b/lib/WebGUI/Asset/RSSFromParent.pm @@ -113,8 +113,9 @@ sub www_view { $subvar->{pubDate} = _escapeXml($self->session->datetime->epochToMail($item->get('dateUpdated'))); } elsif (ref $item eq 'HASH') { foreach my $key (keys %$item) { - my $value = $item->{$key}; - $subvar->{$key} = (ref $value eq 'ARRAY')? join($,, @$value) : _escapeXml($value); + ### This does not do any XML escaping. A way must be found to + # recursively escape the entire data structure. + $subvar->{$key} = $item->{$key}; } } else { $self->session->errorHandler->error("Don't know what to do with this RSS item: $item"); diff --git a/lib/WebGUI/Asset/Wobject/Collaboration.pm b/lib/WebGUI/Asset/Wobject/Collaboration.pm index 327801b2a..5ea64644a 100644 --- a/lib/WebGUI/Asset/Wobject/Collaboration.pm +++ b/lib/WebGUI/Asset/Wobject/Collaboration.pm @@ -673,20 +673,39 @@ sub getRssItems { SQL my $siteUrl = $self->session->url->getSiteURL(); my $datetime = $self->session->datetime; - return map { - my $postId = $_; + + my @posts; + for my $postId (@postIds) { my $post = WebGUI::Asset->new($self->session, $postId, 'WebGUI::Asset::Post::Thread'); my $postUrl = $siteUrl . $post->getUrl; # Buggo: this is an abuse of 'author'. 'author' is supposed to be an email address. # But this is how it was in the original Collaboration RSS, so. - ({ author => $post->get('username'), - title => $post->get('title'), - 'link' => $postUrl, guid => $postUrl, - description => $post->get('synopsis'), - pubDate => $datetime->epochToMail($post->get('dateUpdated')), - attachmentLoop => $self->getRssItemsAttachments($post), - }) - } @postIds; + + # Create the attachment template loop + my $storage = $post->getStorageLocation; + my $attachmentLoop = []; + if ($post->get('storageId')) { + for my $file (@{$storage->getFiles}) { + push @{$attachmentLoop}, { + 'attachment.url' => $storage->getUrl($file), + 'attachment.path' => $storage->getPath($file), + 'attachment.length' => $storage->getFileSize($file), + }; + } + } + + push @posts, { + author => $post->get('username'), + title => $post->get('title'), + 'link' => $postUrl, + guid => $postUrl, + description => $post->get('synopsis'), + pubDate => $datetime->epochToMail($post->get('dateUpdated')), + attachmentLoop => $attachmentLoop, + }; + } + + return @posts; } #-------------------------------------------------------------------