X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Frssaction.php;h=dfaad06358f3021f2e063389b85ea22ccc1a7d9c;hb=035aae2745e25d44ab9fe1b7bdffbcaa505ba970;hp=dac7fa4606e8d4fa5563f4229b10fc8a22b5a275;hpb=83fb5e60235b7cc5acbb01f1c4f398b131d2bbae;p=quix0rs-gnu-social.git diff --git a/lib/rssaction.php b/lib/rssaction.php index dac7fa4606..dfaad06358 100644 --- a/lib/rssaction.php +++ b/lib/rssaction.php @@ -75,7 +75,7 @@ class Rss10Action extends Action * @return boolean success */ - function prepare($args) + function prepare(array $args=array()) { parent::prepare($args); @@ -120,7 +120,7 @@ class Rss10Action extends Action * @return void */ - function handle($args) + function handle(array $args=array()) { // Parent handling, including cache check parent::handle($args); @@ -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)); }