X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fdfrn_poll.php;h=7d5418c364533b4f27c073b9e3dfe0822453bca7;hb=5b4fb945a2f8e950d3f3da8ae1fc8127ff887568;hp=0392c2c920e89923aa824b36fe7fb245231f267c;hpb=a32ba32ff468284641c55c4a08f8b6d949b33c0c;p=friendica.git diff --git a/mod/dfrn_poll.php b/mod/dfrn_poll.php index 0392c2c920..7d5418c364 100644 --- a/mod/dfrn_poll.php +++ b/mod/dfrn_poll.php @@ -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()) { - http_status_exit(403); + System::httpExit(403); } $user = ''; @@ -57,7 +58,7 @@ function dfrn_poll_init(App $a) dbesc($a->argv[1]) ); if (!$r) { - http_status_exit(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)) { - xml_status(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)) { - xml_status(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 - xml_status(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)) { - xml_status(1); + System::xmlExit(1); return; // NOTREACHED } - xml_status(0); + System::xmlExit(0); return; // NOTREACHED } } @@ -236,7 +237,7 @@ function dfrn_poll_post(App $a) dbesc($sec) ); if (!DBM::is_result($r)) { - xml_status(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)) { - xml_status(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 - xml_status(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, '