Move post_url

move post_url function
This commit is contained in:
Adam Magness 2018-01-26 23:24:23 -05:00
parent 2f9642392d
commit a32ba32ff4
12 changed files with 19 additions and 21 deletions

View file

@ -1333,7 +1333,7 @@ class DFRN
logger('dfrn_deliver: ' . "SENDING: " . print_r($postvars, true), LOGGER_DATA);
$xml = post_url($contact['notify'], $postvars);
$xml = Network::postURL($contact['notify'], $postvars);
logger('dfrn_deliver: ' . "RECEIVED: " . $xml, LOGGER_DATA);

View file

@ -3229,7 +3229,7 @@ class Diaspora
if (!intval(Config::get("system", "diaspora_test"))) {
$content_type = (($public_batch) ? "application/magic-envelope+xml" : "application/json");
post_url($dest_url."/", $envelope, ["Content-Type: ".$content_type]);
Network::postURL($dest_url."/", $envelope, ["Content-Type: ".$content_type]);
$return_code = $a->get_curl_code();
} else {
logger("test_mode");

View file

@ -133,7 +133,7 @@ class Salmon
$salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
// slap them
post_url($url, $salmon, [
Network::postURL($url, $salmon, [
'Content-type: application/magic-envelope+xml',
'Content-length: ' . strlen($salmon)
]);
@ -159,7 +159,7 @@ class Salmon
$salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
// slap them
post_url($url, $salmon, [
Network::postURL($url, $salmon, [
'Content-type: application/magic-envelope+xml',
'Content-length: ' . strlen($salmon)
]);
@ -182,10 +182,9 @@ class Salmon
$salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
// slap them
post_url($url, $salmon, [
Network::postURL($url, $salmon, [
'Content-type: application/magic-envelope+xml',
'Content-length: ' . strlen($salmon)]
);
'Content-length: ' . strlen($salmon)]);
$return_code = $a->get_curl_code();
}

View file

@ -380,7 +380,7 @@ class Network
if (filter_var($newurl, FILTER_VALIDATE_URL)) {
$redirects++;
logger('post_url: redirect ' . $url . ' to ' . $newurl);
return post_url($newurl, $params, $headers, $redirects, $timeout);
return self::postURL($newurl, $params, $headers, $redirects, $timeout);
}
}

View file

@ -281,7 +281,7 @@ class OnePoll
$postvars['dfrn_version'] = DFRN_PROTOCOL_VERSION;
$postvars['perm'] = 'rw';
$xml = post_url($contact['poll'], $postvars);
$xml = Network::postURL($contact['poll'], $postvars);
} elseif (($contact['network'] === NETWORK_OSTATUS)
|| ($contact['network'] === NETWORK_DIASPORA)

View file

@ -11,6 +11,7 @@ use Friendica\Core\Config;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
use Friendica\Protocol\OStatus;
use Friendica\Util\Network;
require_once 'include/items.php';
@ -68,7 +69,7 @@ class PubSubPublish {
logger('POST '.print_r($headers, true)."\n".$params, LOGGER_DEBUG);
post_url($rr['callback_url'], $params, $headers);
Network::postURL($rr['callback_url'], $params, $headers);
$ret = $a->get_curl_code();
if ($ret >= 200 && $ret <= 299) {