]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/pocoaddress.php
Partial revert of 073f3e99: restores the original non-hashbang URLs for twitter users...
[quix0rs-gnu-social.git] / lib / pocoaddress.php
index 60873bdc42cd6f7e56c84d415004ea02f2131895..d9f6ff2bdefa8ea988cbb6200a30c2ffa71bd0f7 100644 (file)
@@ -42,15 +42,18 @@ class PoCoAddress
     // @todo Other address fields
 
     function asString()
+    {
+        $xs = new XMLStringer(true);
+        $this->outputTo($xs);
+        return $xs->getString();
+    }
+
+    function outputTo($xo)
     {
         if (!empty($this->formatted)) {
-            $xs = new XMLStringer(true);
-            $xs->elementStart('poco:address');
-            $xs->element('poco:formatted', null, common_xml_safe_str($this->formatted));
-            $xs->elementEnd('poco:address');
-            return $xs->getString();
+            $xo->elementStart('poco:address');
+            $xo->element('poco:formatted', null, common_xml_safe_str($this->formatted));
+            $xo->elementEnd('poco:address');
         }
-
-        return null;
     }
 }