]> git.mxchange.org Git - friendica.git/blobdiff - mod/pubsubhubbub.php
Some more "q" calls and deprecated logging replaced
[friendica.git] / mod / pubsubhubbub.php
index 9403d3eb7fa64b0f3cff176425eb3a60efa938b9..bc90c76d66533ca5ec1df66557637c2bf7b6e583 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -24,7 +24,6 @@ use Friendica\Core\Logger;
 use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Model\PushSubscriber;
-use Friendica\Network\HTTPRequest;
 use Friendica\Util\Strings;
 
 function post_var($name) {
@@ -67,9 +66,9 @@ function pubsubhubbub_init(App $a) {
 
                Logger::log("$hub_mode request from " . $_SERVER['REMOTE_ADDR']);
 
-               if ($a->argc > 1) {
+               if (DI::args()->getArgc() > 1) {
                        // Normally the url should now contain the nick name as last part of the url
-                       $nick = $a->argv[1];
+                       $nick = DI::args()->getArgv()[1];
                } else {
                        // Get the nick name from the topic as a fallback
                        $nick = $hub_topic;
@@ -126,7 +125,7 @@ function pubsubhubbub_init(App $a) {
                $hub_callback = rtrim($hub_callback, ' ?&#');
                $separator = parse_url($hub_callback, PHP_URL_QUERY) === null ? '?' : '&';
 
-               $fetchResult = HTTPRequest::fetchUrlFull($hub_callback . $separator . $params);
+               $fetchResult = DI::httpClient()->fetchFull($hub_callback . $separator . $params);
                $body = $fetchResult->getBody();
                $ret = $fetchResult->getReturnCode();