]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Profile.php
Implemented WebFinger and replaced our XRD with PEAR XML_XRD
[quix0rs-gnu-social.git] / classes / Profile.php
index 8a7f7c1ff80aa7ef371c0e2ff62905a907891536..79eb00d22a48187e02ac0512f4540aabd71438aa 100644 (file)
@@ -1327,12 +1327,26 @@ class Profile extends Managed_DataObject
         return $noun->asString('activity:' . $element);
     }
 
+    /**
+     * Returns the profile's canonical url, not necessarily a uri/unique id
+     *
+     * @return string $profileurl
+     */
+    public function getUrl()
+    {
+        if (empty($this->profileurl) ||
+                !filter_var($this->profileurl, FILTER_VALIDATE_URL)) {
+            throw new InvalidUrlException($this->profileurl);
+        }
+        return $this->profileurl;
+    }
+
     /**
      * Returns the best URI for a profile. Plugins may override.
      *
      * @return string $uri
      */
-    function getUri()
+    public function getUri()
     {
         $uri = null;