]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
OStatus: check only direct children in ActivityUtil::child; fixes pulling actor's...
authorBrion Vibber <brion@pobox.com>
Tue, 16 Feb 2010 23:04:39 +0000 (23:04 +0000)
committerBrion Vibber <brion@pobox.com>
Tue, 16 Feb 2010 23:04:39 +0000 (23:04 +0000)
plugins/OStatus/lib/activity.php

index 3d02e358489a40dd4ed79ddb1dc3ab7dd0b24fd0..5b1c4fa8fae073e99c48ecdc9f88ad22c1fcd7ac 100644 (file)
@@ -106,12 +106,16 @@ class ActivityUtils
 
     static function child($element, $tag, $namespace=self::ATOM)
     {
-        $els = $element->getElementsByTagnameNS($namespace, $tag);
-
+        $els = $element->childNodes;
         if (empty($els) || $els->length == 0) {
             return null;
         } else {
-            return $els->item(0);
+            for ($i = 0; $i < $els->length; $i++) {
+                $el = $els->item($i);
+                if ($el->localName == $tag && $el->namespaceURI == $namespace) {
+                    return $el;
+                }
+            }
         }
     }