From: Brion Vibber Date: Thu, 4 Mar 2010 02:31:35 +0000 (-0800) Subject: OStatus: catchable exception instead of fatal when parsing valid XML that isn't a... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=24835c1164251e48037f6ddee14e4b696fe57320;p=quix0rs-gnu-social.git OStatus: catchable exception instead of fatal when parsing valid XML that isn't a valid XRD doc --- diff --git a/plugins/OStatus/lib/xrd.php b/plugins/OStatus/lib/xrd.php index f00e1f8096..aa13ef0242 100644 --- a/plugins/OStatus/lib/xrd.php +++ b/plugins/OStatus/lib/xrd.php @@ -57,6 +57,9 @@ class XRD throw new Exception("Invalid XML"); } $xrd_element = $dom->getElementsByTagName('XRD')->item(0); + if (!$xrd_element) { + throw new Exception("Invalid XML, missing XRD root"); + } // Check for host-meta host $host = $xrd_element->getElementsByTagName('Host')->item(0);