From: Brion Vibber Date: Tue, 16 Feb 2010 23:04:39 +0000 (+0000) Subject: OStatus: check only direct children in ActivityUtil::child; fixes pulling actor's... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=014a32e6b873291bcd289a1ed25759a7a29221d7;p=quix0rs-gnu-social.git OStatus: check only direct children in ActivityUtil::child; fixes pulling actor's info when we wanted post info --- diff --git a/plugins/OStatus/lib/activity.php b/plugins/OStatus/lib/activity.php index 3d02e35848..5b1c4fa8fa 100644 --- a/plugins/OStatus/lib/activity.php +++ b/plugins/OStatus/lib/activity.php @@ -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; + } + } } }