OStatus: check only direct children in ActivityUtil::child; fixes pulling actor's info when we wanted post info

This commit is contained in:
Brion Vibber 2010-02-16 23:04:39 +00:00
parent 880acb05b0
commit 014a32e6b8

View File

@ -106,12 +106,16 @@ class ActivityUtils
static function child($element, $tag, $namespace=self::ATOM) static function child($element, $tag, $namespace=self::ATOM)
{ {
$els = $element->getElementsByTagnameNS($namespace, $tag); $els = $element->childNodes;
if (empty($els) || $els->length == 0) { if (empty($els) || $els->length == 0) {
return null; return null;
} else { } 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;
}
}
} }
} }