summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-05 10:55:07 -0800
committerBrion Vibber <brion@pobox.com>2010-03-05 10:55:07 -0800
commit89e313e45b1b08fc80ab908e4dd531689319aa6f (patch)
tree44e344806a4c277ae2edffdcc35156a365b075ee /plugins
parent6a377a4ba409083e05d16b163013f0f09c606170 (diff)
OStatus fix: send the feed's root element, not the DOM document, down to low-level feed processing as entry context on PuSH input.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/OStatus/classes/Ostatus_profile.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php
index fcca1a252..abc8100ce 100644
--- a/plugins/OStatus/classes/Ostatus_profile.php
+++ b/plugins/OStatus/classes/Ostatus_profile.php
@@ -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)
{