]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/rssaction.php
No more needed (for this fix) but maybe later. So I always only comment them out.
[quix0rs-gnu-social.git] / lib / rssaction.php
index dac7fa4606e8d4fa5563f4229b10fc8a22b5a275..dfaad06358f3021f2e063389b85ea22ccc1a7d9c 100644 (file)
@@ -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));
             }