]> git.mxchange.org Git - friendica.git/blobdiff - mod/dfrn_poll.php
Add htconfig setting to disable password_exposed()
[friendica.git] / mod / dfrn_poll.php
index 8841a7b5a63b8c82119bad4985cd5a7563e1c24c..7d5418c364533b4f27c073b9e3dfe0822453bca7 100644 (file)
@@ -12,6 +12,7 @@ use Friendica\Module\Login;
 use Friendica\Protocol\DFRN;
 use Friendica\Protocol\OStatus;
 use Friendica\Util\Network;
+use Friendica\Util\XML;
 
 require_once 'include/items.php';
 
@@ -48,7 +49,7 @@ function dfrn_poll_init(App $a)
 
        if (($dfrn_id === '') && (!x($_POST, 'dfrn_id'))) {
                if (Config::get('system', 'block_public') && !local_user() && !remote_user()) {
-                       Network::httpStatusExit(403);
+                       System::httpExit(403);
                }
 
                $user = '';
@@ -57,7 +58,7 @@ function dfrn_poll_init(App $a)
                                dbesc($a->argv[1])
                        );
                        if (!$r) {
-                               Network::httpStatusExit(404);
+                               System::httpExit(404);
                        }
 
                        $hidewall = ($r[0]['hidewall'] && !local_user());
@@ -99,12 +100,12 @@ function dfrn_poll_init(App $a)
                );
 
                if (DBM::is_result($r)) {
-                       $s = Network::fetchURL($r[0]['poll'] . '?dfrn_id=' . $my_id . '&type=profile-check');
+                       $s = Network::fetchUrl($r[0]['poll'] . '?dfrn_id=' . $my_id . '&type=profile-check');
 
                        logger("dfrn_poll: old profile returns " . $s, LOGGER_DATA);
 
                        if (strlen($s)) {
-                               $xml = parse_xml_string($s);
+                               $xml = XML::parseString($s);
 
                                if ((int) $xml->status === 1) {
                                        $_SESSION['authenticated'] = 1;
@@ -144,7 +145,7 @@ function dfrn_poll_init(App $a)
                                dbesc($sec)
                        );
                        if (!DBM::is_result($r)) {
-                               Network::xmlStatus(3, 'No ticket');
+                               System::xmlExit(3, 'No ticket');
                                // NOTREACHED
                        }
 
@@ -157,7 +158,7 @@ function dfrn_poll_init(App $a)
                                intval($r[0]['cid'])
                        );
                        if (!DBM::is_result($c)) {
-                               Network::xmlStatus(3, 'No profile');
+                               System::xmlExit(3, 'No profile');
                        }
 
                        $contact = $c[0];
@@ -184,7 +185,7 @@ function dfrn_poll_init(App $a)
                        if ($final_dfrn_id != $orig_id) {
                                logger('profile_check: ' . $final_dfrn_id . ' != ' . $orig_id, LOGGER_DEBUG);
                                // did not decode properly - cannot trust this site
-                               Network::xmlStatus(3, 'Bad decryption');
+                               System::xmlExit(3, 'Bad decryption');
                        }
 
                        header("Content-type: text/xml");
@@ -208,10 +209,10 @@ function dfrn_poll_init(App $a)
                        $r = q("SELECT * FROM `profile_check` WHERE `dfrn_id` = '%s' ORDER BY `expire` DESC",
                                dbesc($dfrn_id));
                        if (DBM::is_result($r)) {
-                               Network::xmlStatus(1);
+                               System::xmlExit(1);
                                return; // NOTREACHED
                        }
-                       Network::xmlStatus(0);
+                       System::xmlExit(0);
                        return; // NOTREACHED
                }
        }
@@ -236,7 +237,7 @@ function dfrn_poll_post(App $a)
                                dbesc($sec)
                        );
                        if (!DBM::is_result($r)) {
-                               Network::xmlStatus(3, 'No ticket');
+                               System::xmlExit(3, 'No ticket');
                                // NOTREACHED
                        }
 
@@ -249,7 +250,7 @@ function dfrn_poll_post(App $a)
                                intval($r[0]['cid'])
                        );
                        if (!DBM::is_result($c)) {
-                               Network::xmlStatus(3, 'No profile');
+                               System::xmlExit(3, 'No profile');
                        }
 
                        $contact = $c[0];
@@ -276,7 +277,7 @@ function dfrn_poll_post(App $a)
                        if ($final_dfrn_id != $orig_id) {
                                logger('profile_check: ' . $final_dfrn_id . ' != ' . $orig_id, LOGGER_DEBUG);
                                // did not decode properly - cannot trust this site
-                               Network::xmlStatus(3, 'Bad decryption');
+                               System::xmlExit(3, 'Bad decryption');
                        }
 
                        header("Content-type: text/xml");
@@ -482,7 +483,7 @@ function dfrn_poll_content(App $a)
                if (($type === 'profile') && (strlen($sec))) {
                        // URL reply
                        if ($dfrn_version < 2.2) {
-                               $s = Network::fetchURL($r[0]['poll']
+                               $s = Network::fetchUrl($r[0]['poll']
                                        . '?dfrn_id=' . $encrypted_id
                                        . '&type=profile-check'
                                        . '&dfrn_version=' . DFRN_PROTOCOL_VERSION
@@ -490,7 +491,7 @@ function dfrn_poll_content(App $a)
                                        . '&sec=' . $sec
                                );
                        } else {
-                               $s = Network::postURL($r[0]['poll'], [
+                               $s = Network::post($r[0]['poll'], [
                                        'dfrn_id' => $encrypted_id,
                                        'type' => 'profile-check',
                                        'dfrn_version' => DFRN_PROTOCOL_VERSION,
@@ -521,7 +522,7 @@ function dfrn_poll_content(App $a)
                        logger("dfrn_poll: sec profile: " . $s, LOGGER_DATA);
 
                        if (strlen($s) && strstr($s, '<?xml')) {
-                               $xml = parse_xml_string($s);
+                               $xml = XML::parseString($s);
 
                                logger('dfrn_poll: profile: parsed xml: ' . print_r($xml, true), LOGGER_DATA);