File::processNew can return -1 which was not true for empty()

Also, File->getEnclosure() now throws exception if not enough metadata.
This commit is contained in:
Mikael Nordfeldth
2014-06-02 01:26:23 +02:00
parent d596513e39
commit d6f52f5939
5 changed files with 26 additions and 21 deletions

View File

@@ -278,8 +278,8 @@ class Rss10Action extends Action
$attachments = $notice->attachments();
if($attachments){
foreach($attachments as $attachment){
$enclosure=$attachment->getEnclosure();
if ($enclosure) {
try {
$enclosure = $attachment->getEnclosure();
$attribs = array('rdf:resource' => $enclosure->url);
if ($enclosure->title) {
$attribs['dc:title'] = $enclosure->title;
@@ -294,6 +294,8 @@ class Rss10Action extends Action
$attribs['enc:type'] = $enclosure->mimetype;
}
$this->element('enc:enclosure', $attribs);
} catch (ServerException $e) {
// There was not enough metadata available
}
$this->element('sioc:links_to', array('rdf:resource'=>$attachment->url));
}