From 24835c1164251e48037f6ddee14e4b696fe57320 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 3 Mar 2010 18:31:35 -0800 Subject: OStatus: catchable exception instead of fatal when parsing valid XML that isn't a valid XRD doc --- plugins/OStatus/lib/xrd.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugins/OStatus') diff --git a/plugins/OStatus/lib/xrd.php b/plugins/OStatus/lib/xrd.php index f00e1f809..aa13ef024 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); -- cgit v1.2.3-54-g00ecf