diff options
author | Brion Vibber <brion@pobox.com> | 2010-02-16 23:04:39 +0000 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-02-16 23:04:39 +0000 |
commit | 014a32e6b873291bcd289a1ed25759a7a29221d7 (patch) | |
tree | e8c373c9aaab950d3384be5932b69d4ad46a79ef /plugins/OStatus/lib/activity.php | |
parent | 880acb05b0f51f873e72a7b4d322cefafe7e850c (diff) |
OStatus: check only direct children in ActivityUtil::child; fixes pulling actor's info when we wanted post info
Diffstat (limited to 'plugins/OStatus/lib/activity.php')
-rw-r--r-- | plugins/OStatus/lib/activity.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/OStatus/lib/activity.php b/plugins/OStatus/lib/activity.php index 3d02e3584..5b1c4fa8f 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; + } + } } } |