summaryrefslogtreecommitdiff
path: root/lib/activity.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-04 10:16:59 -0800
committerBrion Vibber <brion@pobox.com>2010-03-04 10:16:59 -0800
commitf969d6349c244e2ec32c3ebe7eb355426006f4db (patch)
treeb66cd619681ffd868178ae3d4b8f6103adcc036e /lib/activity.php
parentb218aee94e581230e1efa14d4ae1a19756986ddf (diff)
parentb720c7554be2a8e15c3772fe1071c48cf91935d6 (diff)
Merge branch 'testing' into 0.9.x
Conflicts: db/08to09.sql
Diffstat (limited to 'lib/activity.php')
-rw-r--r--lib/activity.php32
1 files changed, 18 insertions, 14 deletions
diff --git a/lib/activity.php b/lib/activity.php
index e1bce6f19..2cb80f9e1 100644
--- a/lib/activity.php
+++ b/lib/activity.php
@@ -344,16 +344,18 @@ class ActivityUtils
static function getLink(DOMNode $element, $rel, $type=null)
{
- $links = $element->getElementsByTagnameNS(self::ATOM, self::LINK);
+ $els = $element->childNodes;
- foreach ($links as $link) {
+ foreach ($els as $link) {
+ if ($link->localName == self::LINK && $link->namespaceURI == self::ATOM) {
- $linkRel = $link->getAttribute(self::REL);
- $linkType = $link->getAttribute(self::TYPE);
+ $linkRel = $link->getAttribute(self::REL);
+ $linkType = $link->getAttribute(self::TYPE);
- if ($linkRel == $rel &&
- (is_null($type) || $linkType == $type)) {
- return $link->getAttribute(self::HREF);
+ if ($linkRel == $rel &&
+ (is_null($type) || $linkType == $type)) {
+ return $link->getAttribute(self::HREF);
+ }
}
}
@@ -362,17 +364,19 @@ class ActivityUtils
static function getLinks(DOMNode $element, $rel, $type=null)
{
- $links = $element->getElementsByTagnameNS(self::ATOM, self::LINK);
+ $els = $element->childNodes;
$out = array();
- foreach ($links as $link) {
+ foreach ($els as $link) {
+ if ($link->localName == self::LINK && $link->namespaceURI == self::ATOM) {
- $linkRel = $link->getAttribute(self::REL);
- $linkType = $link->getAttribute(self::TYPE);
+ $linkRel = $link->getAttribute(self::REL);
+ $linkType = $link->getAttribute(self::TYPE);
- if ($linkRel == $rel &&
- (is_null($type) || $linkType == $type)) {
- $out[] = $link;
+ if ($linkRel == $rel &&
+ (is_null($type) || $linkType == $type)) {
+ $out[] = $link;
+ }
}
}