From ffa1931c9dafea385e8f30c53ea079e2425a0786 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 3 Mar 2010 09:31:14 -0800 Subject: Avoid warning/notice spew in XRD parser. Not all DOM nodes are elements. --- plugins/OStatus/lib/xrd.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'plugins/OStatus/lib') diff --git a/plugins/OStatus/lib/xrd.php b/plugins/OStatus/lib/xrd.php index 85df26c54..f00e1f809 100644 --- a/plugins/OStatus/lib/xrd.php +++ b/plugins/OStatus/lib/xrd.php @@ -149,9 +149,11 @@ class XRD $link['href'] = $element->getAttribute('href'); $link['template'] = $element->getAttribute('template'); foreach ($element->childNodes as $node) { - switch($node->tagName) { - case 'Title': - $link['title'][] = $node->nodeValue; + if ($node instanceof DOMElement) { + switch($node->tagName) { + case 'Title': + $link['title'][] = $node->nodeValue; + } } } -- cgit v1.2.3-54-g00ecf