]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/OStatus/lib/feeddiscovery.php
Merge branch '0.9.x' into 1.0.x
[quix0rs-gnu-social.git] / plugins / OStatus / lib / feeddiscovery.php
index 4ac243832617b89b00737b3e497f9ed27dc662a4..8a166a0be56f339d0aeb54cfb08629aef15ae83c 100644 (file)
@@ -87,6 +87,16 @@ class FeedDiscovery
         return ActivityUtils::getLink($this->root, $rel, $type);
     }
 
+    /**
+     * Get the referenced PuSH hub link from an Atom feed.
+     *
+     * @return mixed string or false
+     */
+    public function getHubLink()
+    {
+        return $this->getAtomLink('hub');
+    }
+
     /**
      * @param string $url
      * @param bool $htmlOk pass false here if you don't want to follow web pages.
@@ -186,8 +196,9 @@ class FeedDiscovery
      */
     function discoverFromHTML($url, $body)
     {
-        // DOMDocument::loadHTML may throw warnings on unrecognized elements.
-        $old = error_reporting(error_reporting() & ~E_WARNING);
+        // DOMDocument::loadHTML may throw warnings on unrecognized elements,
+        // and notices on unrecognized namespaces.
+        $old = error_reporting(error_reporting() & ~(E_WARNING | E_NOTICE));
         $dom = new DOMDocument();
         $ok = $dom->loadHTML($body);
         error_reporting($old);