summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-03 18:31:35 -0800
committerBrion Vibber <brion@pobox.com>2010-03-03 18:31:35 -0800
commit24835c1164251e48037f6ddee14e4b696fe57320 (patch)
treece72d64c061cb1d4cdaec5b92a41eb4516121034 /plugins
parent14065ca350cae576461f1a2db33694e38cebf751 (diff)
OStatus: catchable exception instead of fatal when parsing valid XML that isn't a valid XRD doc
Diffstat (limited to 'plugins')
-rw-r--r--plugins/OStatus/lib/xrd.php3
1 files changed, 3 insertions, 0 deletions
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);