From: Brion Vibber Date: Fri, 13 Aug 2010 17:51:00 +0000 (-0700) Subject: Suppress whinging during HTML parsing in profile page discovery for things that turn... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=115231f917c9c9c67fe3768310c4852d8e1cada1;p=quix0rs-gnu-social.git Suppress whinging during HTML parsing in profile page discovery for things that turn out to be XML feeds with funny namespaces. --- diff --git a/plugins/OStatus/lib/discoveryhints.php b/plugins/OStatus/lib/discoveryhints.php index 34c9be2777..fa2ead7320 100644 --- a/plugins/OStatus/lib/discoveryhints.php +++ b/plugins/OStatus/lib/discoveryhints.php @@ -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); diff --git a/plugins/OStatus/lib/feeddiscovery.php b/plugins/OStatus/lib/feeddiscovery.php index a55399d7c8..8a166a0be5 100644 --- a/plugins/OStatus/lib/feeddiscovery.php +++ b/plugins/OStatus/lib/feeddiscovery.php @@ -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);