]> git.mxchange.org Git - friendica.git/blobdiff - mod/pubsub.php
Merge pull request #11575 from annando/issue-11469
[friendica.git] / mod / pubsub.php
index f8f62754de8630359453f560530e2239e03736d0..918c55ee14cb817f192232c675ff112ea79792c9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -22,6 +22,7 @@
 use Friendica\App;
 use Friendica\Core\Logger;
 use Friendica\Core\Protocol;
+use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Model\Contact;
@@ -38,7 +39,7 @@ function hub_return($valid, $body)
        } else {
                throw new \Friendica\Network\HTTPException\NotFoundException();
        }
-       exit();
+       System::exit();
 }
 
 // when receiving an XML feed, always return OK
@@ -53,7 +54,7 @@ function pubsub_init(App $a)
        $nick       = ((DI::args()->getArgc() > 1) ? trim(DI::args()->getArgv()[1])   : '');
        $contact_id = ((DI::args()->getArgc() > 2) ? intval(DI::args()->getArgv()[2]) : 0 );
 
-       if ($_SERVER['REQUEST_METHOD'] === 'GET') {
+       if (DI::args()->getMethod() === App\Router::GET) {
                $hub_mode      = trim($_GET['hub_mode']         ?? '');
                $hub_topic     = trim($_GET['hub_topic']        ?? '');
                $hub_challenge = trim($_GET['hub_challenge']    ?? '');