Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing

This commit is contained in:
Sarven Capadisli 2010-03-04 11:32:59 -05:00
commit 4a03b66545
1 changed files with 18 additions and 14 deletions

View File

@ -344,9 +344,10 @@ class ActivityUtils
static function getLink(DOMNode $element, $rel, $type=null) 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); $linkRel = $link->getAttribute(self::REL);
$linkType = $link->getAttribute(self::TYPE); $linkType = $link->getAttribute(self::TYPE);
@ -356,16 +357,18 @@ class ActivityUtils
return $link->getAttribute(self::HREF); return $link->getAttribute(self::HREF);
} }
} }
}
return null; return null;
} }
static function getLinks(DOMNode $element, $rel, $type=null) static function getLinks(DOMNode $element, $rel, $type=null)
{ {
$links = $element->getElementsByTagnameNS(self::ATOM, self::LINK); $els = $element->childNodes;
$out = array(); $out = array();
foreach ($links as $link) { foreach ($els as $link) {
if ($link->localName == self::LINK && $link->namespaceURI == self::ATOM) {
$linkRel = $link->getAttribute(self::REL); $linkRel = $link->getAttribute(self::REL);
$linkType = $link->getAttribute(self::TYPE); $linkType = $link->getAttribute(self::TYPE);
@ -375,6 +378,7 @@ class ActivityUtils
$out[] = $link; $out[] = $link;
} }
} }
}
return $out; return $out;
} }