From: Mikael Nordfeldth Date: Fri, 21 Apr 2017 06:08:39 +0000 (+0200) Subject: Split OStatusPlugin FeedSub receive into two parts X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f51cb6fca9631bf26b1a15ebdbc37f1365da9cc2;p=quix0rs-gnu-social.git Split OStatusPlugin FeedSub receive into two parts FeedSub::receive now only handles the PuSH verification FeedSub::receiveFeed is protected and only parses+imports feed XML --- diff --git a/plugins/OStatus/classes/FeedSub.php b/plugins/OStatus/classes/FeedSub.php index 13a5439421..2d360afedd 100644 --- a/plugins/OStatus/classes/FeedSub.php +++ b/plugins/OStatus/classes/FeedSub.php @@ -460,8 +460,15 @@ class FeedSub extends Managed_DataObject return; } + $this->receiveFeed($post); + } + + protected function receiveFeed($feed_xml) + { + // We're passed the XML for the Atom feed as $feed_xml, + // so read it into a DOMDocument and process. $feed = new DOMDocument(); - if (!$feed->loadXML($post)) { + if (!$feed->loadXML($feed_xml)) { // @fixme might help to include the err message common_log(LOG_ERR, __METHOD__ . ": ignoring invalid XML"); return;