X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Frssaction.php;h=3c75dfa6e49f5e244a8d9bbe4c92628ccec6b0eb;hb=b53e1439969bfa2c0b551d8cc2fc8fe15652c62a;hp=dac7fa4606e8d4fa5563f4229b10fc8a22b5a275;hpb=87d46e1ae5e5effcc985021ff5af3f10815f3d3c;p=quix0rs-gnu-social.git diff --git a/lib/rssaction.php b/lib/rssaction.php index dac7fa4606..3c75dfa6e4 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); @@ -89,7 +89,7 @@ class Rss10Action extends Action if (!isset($_SERVER['PHP_AUTH_USER'])) { // This header makes basic auth go - header('WWW-Authenticate: Basic realm="StatusNet RSS"'); + header('WWW-Authenticate: Basic realm="GNU social RSS"'); // If the user hits cancel -- bam! $this->show_basic_auth_error(); @@ -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)); }