diff options
author | Brion Vibber <brion@pobox.com> | 2010-03-08 13:37:45 -0800 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-03-08 13:37:45 -0800 |
commit | 42463e160d6672f6e5e458a22ddae79b62fa39bf (patch) | |
tree | e0733a6cbb4d2bac34c2a8fc604e32e5363b41f7 /plugins/OStatus | |
parent | ef3991dbbe0acdba2dd7050b99f951ccfe5b8258 (diff) | |
parent | 7e7d88831cf8b3e8876499b86890da2e63b08c97 (diff) |
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'plugins/OStatus')
-rw-r--r-- | plugins/OStatus/classes/Ostatus_profile.php | 13 |
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) { |