Commit 014a32e6 authored by Brion Vibber's avatar Brion Vibber

OStatus: check only direct children in ActivityUtil::child; fixes pulling...

OStatus: check only direct children in ActivityUtil::child; fixes pulling actor's info when we wanted post info
parent 880acb05
......@@ -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;
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment