]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Avoid warning/notice spew in XRD parser. Not all DOM nodes are elements.
authorBrion Vibber <brion@pobox.com>
Wed, 3 Mar 2010 17:31:14 +0000 (09:31 -0800)
committerBrion Vibber <brion@pobox.com>
Wed, 3 Mar 2010 17:31:14 +0000 (09:31 -0800)
plugins/OStatus/lib/xrd.php

index 85df26c54cb752605c9babb4bccd4ef65f690085..f00e1f80968b8380a3efa3c0e2fa732d7183c3f1 100644 (file)
@@ -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;
+                }
             }
         }