]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
OStatus fix: send the feed's root element, not the DOM document, down to low-level...
authorBrion Vibber <brion@pobox.com>
Fri, 5 Mar 2010 18:55:07 +0000 (10:55 -0800)
committerBrion Vibber <brion@pobox.com>
Fri, 5 Mar 2010 18:55:07 +0000 (10:55 -0800)
plugins/OStatus/classes/Ostatus_profile.php

index fcca1a25219e0746530b186f0ff3062f926d4d9d..abc8100cee792dbbcfda1fbd09d3fdb1c9c65aa1 100644 (file)
@@ -428,10 +428,18 @@ class Ostatus_profile extends Memcached_DataObject
      * Currently assumes that all items in the feed are new,
      * coming from a PuSH hub.
      *
-     * @param DOMDocument $feed
+     * @param DOMDocument $doc
+     * @param string $source identifier ("push")
      */
-    public function processFeed($feed, $source)
+    public function processFeed(DOMDocument $doc, $source)
     {
+        $feed = $doc->documentElement;
+
+        if ($feed->localName != 'feed' || $feed->namespaceURI != Activity::ATOM) {
+            common_log(LOG_ERR, __METHOD__ . ": not an Atom feed, ignoring");
+            return;
+        }
+
         $entries = $feed->getElementsByTagNameNS(Activity::ATOM, 'entry');
         if ($entries->length == 0) {
             common_log(LOG_ERR, __METHOD__ . ": no entries in feed update, ignoring");
@@ -449,6 +457,7 @@ class Ostatus_profile extends Memcached_DataObject
      *
      * @param DOMElement $entry
      * @param DOMElement $feed for context
+     * @param string $source identifier ("push" or "salmon")
      */
     public function processEntry($entry, $feed, $source)
     {