diff options
author | Brion Vibber <brion@pobox.com> | 2010-03-23 14:18:45 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-03-23 14:18:45 -0700 |
commit | 5f32cf32cd7d4a5df7ba64d4f1e7d9edee8d418c (patch) | |
tree | 063b2c04f51b78f5626d2e716b8ffcb19527bf4d /plugins/OStatus/lib | |
parent | 7dc24b4ca7dffda85338d35da3618ec50ce0dbf7 (diff) |
Don't spew XML parse warnings to output when checking a remote XRD page
Diffstat (limited to 'plugins/OStatus/lib')
-rw-r--r-- | plugins/OStatus/lib/xrd.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/OStatus/lib/xrd.php b/plugins/OStatus/lib/xrd.php index aa13ef024..34b28790b 100644 --- a/plugins/OStatus/lib/xrd.php +++ b/plugins/OStatus/lib/xrd.php @@ -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); |