]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
OStatus: catchable exception instead of fatal when parsing valid XML that isn't a...
authorBrion Vibber <brion@pobox.com>
Thu, 4 Mar 2010 02:31:35 +0000 (18:31 -0800)
committerBrion Vibber <brion@pobox.com>
Thu, 4 Mar 2010 02:31:35 +0000 (18:31 -0800)
plugins/OStatus/lib/xrd.php

index f00e1f80968b8380a3efa3c0e2fa732d7183c3f1..aa13ef02428faf623b5c128e0c5e38e47fdfeeab 100644 (file)
@@ -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);