]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Don't spew XML parse warnings to output when checking a remote XRD page
authorBrion Vibber <brion@pobox.com>
Tue, 23 Mar 2010 21:18:45 +0000 (14:18 -0700)
committerBrion Vibber <brion@pobox.com>
Tue, 23 Mar 2010 21:18:45 +0000 (14:18 -0700)
plugins/OStatus/lib/xrd.php

index aa13ef02428faf623b5c128e0c5e38e47fdfeeab..34b28790b7452b9bea3e74e70ed2425e8f80c4fe 100644 (file)
@@ -53,7 +53,14 @@ class XRD
         $xrd = new XRD();
 
         $dom = new DOMDocument();
-        if (!$dom->loadXML($xml)) {
+
+        // Don't spew XML warnings to output
+        $old = error_reporting();
+        error_reporting($old & ~E_WARNING);
+        $ok = $dom->loadXML($xml);
+        error_reporting($old);
+
+        if (!$ok) {
             throw new Exception("Invalid XML");
         }
         $xrd_element = $dom->getElementsByTagName('XRD')->item(0);