summaryrefslogtreecommitdiff
path: root/plugins/OStatus/lib/xrd.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-01 16:35:36 -0800
committerBrion Vibber <brion@pobox.com>2010-03-01 16:35:36 -0800
commit45e8819c1b9cc618e9b2d6678b0ff14c653a09d3 (patch)
tree3ebeec58361978add7cbe84c755c1fc2900a5f99 /plugins/OStatus/lib/xrd.php
parent0512151eabf64e88b4648869b3d029800d30668a (diff)
Fix a bunch of notice & warning-level messages that were breaking my inter-instance communications
Diffstat (limited to 'plugins/OStatus/lib/xrd.php')
-rw-r--r--plugins/OStatus/lib/xrd.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/plugins/OStatus/lib/xrd.php b/plugins/OStatus/lib/xrd.php
index 16d27f8eb..1de065db9 100644
--- a/plugins/OStatus/lib/xrd.php
+++ b/plugins/OStatus/lib/xrd.php
@@ -53,17 +53,22 @@ class XRD
$xrd = new XRD();
$dom = new DOMDocument();
- $dom->loadXML($xml);
+ if (!$dom->loadXML($xml)) {
+ throw new Exception("Invalid XML");
+ }
$xrd_element = $dom->getElementsByTagName('XRD')->item(0);
// Check for host-meta host
- $host = $xrd_element->getElementsByTagName('Host')->item(0)->nodeValue;
+ $host = $xrd_element->getElementsByTagName('Host')->item(0);
if ($host) {
- $xrd->host = $host;
+ $xrd->host = $host->nodeValue;
}
// Loop through other elements
foreach ($xrd_element->childNodes as $node) {
+ if (!($node instanceof DOMElement)) {
+ continue;
+ }
switch ($node->tagName) {
case 'Expires':
$xrd->expires = $node->nodeValue;