]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/rssaction.php
Misses this file to merge. I like the comments.
[quix0rs-gnu-social.git] / lib / rssaction.php
index dac7fa4606e8d4fa5563f4229b10fc8a22b5a275..3c75dfa6e49f5e244a8d9bbe4c92628ccec6b0eb 100644 (file)
@@ -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));
             }