]> git.mxchange.org Git - friendica.git/blobdiff - mod/dfrn_poll.php
Fetch photo fields, ensuring that they are filled
[friendica.git] / mod / dfrn_poll.php
index 14221c7e6e58458a3ef807538c6994aee1e43944..3d073dc8ead9cf1fa1cc4d5ea856299d74c43d39 100644 (file)
 
 use Friendica\App;
 use Friendica\Core\Logger;
-use Friendica\Core\System;
 use Friendica\Core\Session;
+use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Protocol\DFRN;
 use Friendica\Protocol\OStatus;
-use Friendica\Util\Network;
 use Friendica\Util\Strings;
 use Friendica\Util\XML;
 
@@ -115,7 +114,7 @@ function dfrn_poll_init(App $a)
                );
 
                if (DBA::isResult($r)) {
-                       $s = Network::fetchUrl($r[0]['poll'] . '?dfrn_id=' . $my_id . '&type=profile-check');
+                       $s = DI::httpRequest()->fetch($r[0]['poll'] . '?dfrn_id=' . $my_id . '&type=profile-check');
 
                        Logger::log("dfrn_poll: old profile returns " . $s, Logger::DATA);
 
@@ -133,7 +132,7 @@ function dfrn_poll_init(App $a)
                                        Session::setVisitorsContacts();
 
                                        if (!$quiet) {
-                                               info(DI::l10n()->t('%1$s welcomes %2$s', $r[0]['username'], $r[0]['name']) . EOL);
+                                               info(DI::l10n()->t('%1$s welcomes %2$s', $r[0]['username'], $r[0]['name']));
                                        }
 
                                        // Visitors get 1 day session.
@@ -379,7 +378,7 @@ function dfrn_poll_post(App $a)
                // NOTREACHED
        } else {
                // Update the writable flag if it changed
-               Logger::log('dfrn_poll: post request feed: ' . print_r($_POST, true), Logger::DATA);
+               Logger::debug('post request feed', ['post' => $_POST]);
                if ($dfrn_version >= 2.21) {
                        if ($perm === 'rw') {
                                $writable = 1;
@@ -499,20 +498,20 @@ function dfrn_poll_content(App $a)
 
                        // URL reply
                        if ($dfrn_version < 2.2) {
-                               $s = Network::fetchUrl($r[0]['poll']
-                                       . '?dfrn_id=' . $encrypted_id
-                                       . '&type=profile-check'
-                                       . '&dfrn_version=' . DFRN_PROTOCOL_VERSION
-                                       . '&challenge=' . $challenge
-                                       . '&sec=' . $sec
+                               $s = DI::httpRequest()->fetch($r[0]['poll']
+                                                             . '?dfrn_id=' . $encrypted_id
+                                                             . '&type=profile-check'
+                                                             . '&dfrn_version=' . DFRN_PROTOCOL_VERSION
+                                                             . '&challenge=' . $challenge
+                                                             . '&sec=' . $sec
                                );
                        } else {
-                               $s = Network::post($r[0]['poll'], [
-                                       'dfrn_id' => $encrypted_id,
-                                       'type' => 'profile-check',
+                               $s = DI::httpRequest()->post($r[0]['poll'], [
+                                       'dfrn_id'      => $encrypted_id,
+                                       'type'         => 'profile-check',
                                        'dfrn_version' => DFRN_PROTOCOL_VERSION,
-                                       'challenge' => $challenge,
-                                       'sec' => $sec
+                                       'challenge'    => $challenge,
+                                       'sec'          => $sec
                                ])->getBody();
                        }
 
@@ -521,7 +520,7 @@ function dfrn_poll_content(App $a)
                        if (strlen($s) && strstr($s, '<?xml')) {
                                $xml = XML::parseString($s);
 
-                               Logger::log('dfrn_poll: profile: parsed xml: ' . print_r($xml, true), Logger::DATA);
+                               Logger::debug(' profile: parsed', ['xml' => $xml]);
 
                                Logger::log('dfrn_poll: secure profile: challenge: ' . $xml->challenge . ' expecting ' . $hash);
                                Logger::log('dfrn_poll: secure profile: sec: ' . $xml->sec . ' expecting ' . $sec);
@@ -536,7 +535,7 @@ function dfrn_poll_content(App $a)
                                        Session::setVisitorsContacts();
 
                                        if (!$quiet) {
-                                               info(DI::l10n()->t('%1$s welcomes %2$s', $r[0]['username'], $r[0]['name']) . EOL);
+                                               info(DI::l10n()->t('%1$s welcomes %2$s', $r[0]['username'], $r[0]['name']));
                                        }
 
                                        // Visitors get 1 day session.