Move z_fetch_url

move z_fetch_url method
This commit is contained in:
Adam Magness 2018-01-26 23:18:38 -05:00
commit 2f9642392d
14 changed files with 58 additions and 60 deletions

View file

@ -8,6 +8,7 @@ use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Model\Contact;
use Friendica\Network\Probe;
use Friendica\Util\Network;
function ostatus_subscribe_content(App $a) {
@ -40,7 +41,7 @@ function ostatus_subscribe_content(App $a) {
$api = $contact["baseurl"]."/api/";
// Fetching friends
$data = z_fetch_url($api."statuses/friends.json?screen_name=".$contact["nick"]);
$data = Network::zFetchURL($api."statuses/friends.json?screen_name=".$contact["nick"]);
if (!$data["success"]) {
return $o.L10n::t("Couldn't fetch friends for contact.");

View file

@ -12,6 +12,7 @@
use Friendica\App;
use Friendica\Core\Addon;
use Friendica\Util\Network;
use Friendica\Util\ParseUrl;
require_once("include/items.php");
@ -60,7 +61,7 @@ function parse_url_content(App $a) {
// the URL with the corresponding BBCode media tag
$redirects = 0;
// Fetch the header of the URL
$result = z_fetch_url($url, false, $redirects, ["novalidate" => true, "nobody" => true]);
$result = Network::zFetchURL($url, false, $redirects, ["novalidate" => true, "nobody" => true]);
if($result["success"]) {
// Convert the header fields into an array
$hdrs = [];