From: Brion Vibber Date: Wed, 3 Mar 2010 17:31:14 +0000 (-0800) Subject: Avoid warning/notice spew in XRD parser. Not all DOM nodes are elements. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ffa1931c9dafea385e8f30c53ea079e2425a0786;p=quix0rs-gnu-social.git Avoid warning/notice spew in XRD parser. Not all DOM nodes are elements. --- diff --git a/plugins/OStatus/lib/xrd.php b/plugins/OStatus/lib/xrd.php index 85df26c54c..f00e1f8096 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; + } } }