Avoid warning/notice spew in XRD parser. Not all DOM nodes are elements.

This commit is contained in:
Brion Vibber 2010-03-03 09:31:14 -08:00
parent f7ba5566bc
commit ffa1931c9d

View File

@ -149,9 +149,11 @@ class XRD
$link['href'] = $element->getAttribute('href'); $link['href'] = $element->getAttribute('href');
$link['template'] = $element->getAttribute('template'); $link['template'] = $element->getAttribute('template');
foreach ($element->childNodes as $node) { foreach ($element->childNodes as $node) {
switch($node->tagName) { if ($node instanceof DOMElement) {
case 'Title': switch($node->tagName) {
$link['title'][] = $node->nodeValue; case 'Title':
$link['title'][] = $node->nodeValue;
}
} }
} }