]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'testing'
authorEvan Prodromou <evan@status.net>
Wed, 3 Mar 2010 23:20:45 +0000 (18:20 -0500)
committerEvan Prodromou <evan@status.net>
Wed, 3 Mar 2010 23:20:45 +0000 (18:20 -0500)
lib/activity.php

index ce14fa254607eec1e8d0a504b1bade0e22c25e59..7334239ec3c47f91031f7c60a431d2e9c42417e4 100644 (file)
@@ -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;
+                }
             }
         }