} $hubChallenge = $_GET['hub_challenge']; if (!isset($_GET['hub_lease_seconds'])) { header('HTTP/1.0 400 Bad Request'); echo "Parameter missing: hub.lease_seconds\n"; exit(1); } $hubLeaseSeconds = $_GET['hub_lease_seconds']; //FIXME: store in database header('HTTP/1.0 200 OK'); header('Content-type: text/plain'); echo $hubChallenge; exit(0); } else { if ($hubMode == 'unsubscribe') { $sub = $subDb->get($hubTopic); if ($sub === false) { //we do not know this subscription header('HTTP/1.0 404 Not Found'); echo "We are not subscribed to this hub.topic\n"; exit(1); } $pos = array_search($hubTopic, $GLOBALS['phinde']['subscriptions']); if ($pos !== false) { //we do not want to unsubscribe header('HTTP/1.0 404 Not Found'); echo "We do not want to unsubscribe from this hub.topic\n"; exit(1); } $sub->remove($hubTopic); header('HTTP/1.0 200 OK');