]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/xrd.php
Links to photo pages in gallery
[quix0rs-gnu-social.git] / lib / xrd.php
index 145cd64cb4e92ddb42d5fd77b8e8b6a81c1ab562..9c6d9f3ab70044a4d8573ff713c38778fca51f88 100644 (file)
@@ -27,7 +27,6 @@
  * @link      http://status.net/
  */
 
-
 class XRD
 {
     const XML_NS = 'http://www.w3.org/2000/xmlns/';
@@ -61,11 +60,13 @@ class XRD
         error_reporting($old);
 
         if (!$ok) {
-            throw new Exception("Invalid XML.");
+            // TRANS: Exception.
+            throw new Exception(_m('Invalid XML.'));
         }
         $xrd_element = $dom->getElementsByTagName('XRD')->item(0);
         if (!$xrd_element) {
-            throw new Exception("Invalid XML, missing XRD root.");
+            // TRANS: Exception.
+            throw new Exception(_m('Invalid XML, missing XRD root.'));
         }
 
         // Check for host-meta host
@@ -129,14 +130,24 @@ class XRD
 
         foreach ($this->links as $link) {
             $titles = array();
+            $properties = array();
             if (isset($link['title'])) {
                 $titles = $link['title'];
                 unset($link['title']);
             }
+            if (isset($link['property'])) {
+                $properties = $link['property'];
+                unset($link['property']);
+            }
             $xs->elementStart('Link', $link);
             foreach ($titles as $title) {
                 $xs->element('Title', null, $title);
             }
+            foreach ($properties as $property) {
+                $xs->element('Property',
+                             array('type' => $property['type']),
+                             $property['value']);
+            }
             $xs->elementEnd('Link');
         }