summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-04 07:53:08 -0800
committerBrion Vibber <brion@pobox.com>2010-03-04 07:53:08 -0800
commit865b3200459f3e3dbb165559b600a08638e0dec2 (patch)
tree187d8995a9036517248809aed57d8e2782b4869a
parent8b3febab5539a3c08da15c78578650ffca41f75e (diff)
parent62d5f1addb1b710a387f7732ace1dd33bd1b86c1 (diff)
Merge branch 'master' into testing
-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;
+ }
}
}