summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@status.net>2010-03-04 11:32:59 -0500
committerSarven Capadisli <csarven@status.net>2010-03-04 11:32:59 -0500
commit4a03b665454c0b46307455ec2348f47d436311e7 (patch)
tree091edc82c01fbba2256b1c4c47117f31c6596aee
parent0cf0a684ce32a4c79cf05d108d6da38052be5bd8 (diff)
parent865b3200459f3e3dbb165559b600a08638e0dec2 (diff)
Merge branch 'testing' of git@gitorious.org:statusnet/mainline 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;
+ }
}
}