use Friendica\Model\Contact;
use Friendica\Protocol\OStatus;
use Friendica\Util\Strings;
+use Friendica\Util\Network;
use Friendica\Core\System;
function hub_return($valid, $body)
{
if ($valid) {
- header($_SERVER["SERVER_PROTOCOL"] . ' 200 OK');
echo $body;
} else {
- System::httpExit(404);
+ throw new \Friendica\Network\HTTPException\NotFoundException();
}
exit();
}
function hub_post_return()
{
- System::httpExit(200);
+ throw new \Friendica\Network\HTTPException\OKException();
}
function pubsub_init(App $a)
function pubsub_post(App $a)
{
- $xml = file_get_contents('php://input');
+ $xml = Network::postdata();
Logger::log('Feed arrived from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . $a->cmd . ' with user-agent: ' . $_SERVER['HTTP_USER_AGENT']);
Logger::log('Data: ' . $xml, Logger::DATA);