]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
- Output georss xmlns in rss element
authorZach Copley <zach@status.net>
Thu, 11 Mar 2010 23:05:56 +0000 (23:05 +0000)
committerZach Copley <zach@status.net>
Thu, 11 Mar 2010 23:05:56 +0000 (23:05 +0000)
- Only output geopoint in rss if one is set

lib/apiaction.php

index e4a1df3d198400fd3aa64b03c2a8d36cf5af425e..fd09f3d426c27d13c1a144d67e15715c374bdc50 100644 (file)
@@ -541,13 +541,12 @@ class ApiAction extends Action
 
     function showGeoRSS($geo)
     {
-        if (empty($geo)) {
-            // empty geo element
-            $this->element('geo');
-        } else {
-            $this->elementStart('geo', array('xmlns:georss' => 'http://www.georss.org/georss'));
-            $this->element('georss:point', null, $geo['coordinates'][0] . ' ' . $geo['coordinates'][1]);
-            $this->elementEnd('geo');
+        if (!empty($geo)) {
+            $this->element(
+                'georss:point',
+                null,
+                $geo['coordinates'][0] . ' ' . $geo['coordinates'][1]
+            );
         }
     }
 
@@ -1138,7 +1137,14 @@ class ApiAction extends Action
     function initTwitterRss()
     {
         $this->startXML();
-        $this->elementStart('rss', array('version' => '2.0', 'xmlns:atom'=>'http://www.w3.org/2005/Atom'));
+        $this->elementStart(
+            'rss',
+            array(
+                'version'      => '2.0',
+                'xmlns:atom'   => 'http://www.w3.org/2005/Atom',
+                'xmlns:georss' => 'http://www.georss.org/georss'
+            )
+        );
         $this->elementStart('channel');
         Event::handle('StartApiRss', array($this));
     }