]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Suppress whinging during HTML parsing in profile page discovery for things that turn...
authorBrion Vibber <brion@pobox.com>
Fri, 13 Aug 2010 17:51:00 +0000 (10:51 -0700)
committerBrion Vibber <brion@pobox.com>
Fri, 13 Aug 2010 17:51:00 +0000 (10:51 -0700)
plugins/OStatus/lib/discoveryhints.php
plugins/OStatus/lib/feeddiscovery.php

index 34c9be277745be7221a64bcda71d49a8f929027d..fa2ead7320cb8640b7c9c108b52756273c053c30 100644 (file)
@@ -114,9 +114,10 @@ class DiscoveryHints {
 
     static function _hcard($body, $url)
     {
-        // DOMDocument::loadHTML may throw warnings on unrecognized elements.
+        // DOMDocument::loadHTML may throw warnings on unrecognized elements,
+        // and notices on unrecognized namespaces.
 
-        $old = error_reporting(error_reporting() & ~E_WARNING);
+        $old = error_reporting(error_reporting() & ~(E_WARNING | E_NOTICE));
 
         $doc = new DOMDocument();
         $doc->loadHTML($body);
index a55399d7c8e9ef29cfa45bd83e4a15b6866859d9..8a166a0be56f339d0aeb54cfb08629aef15ae83c 100644 (file)
@@ -196,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);