Move fetch_url

move fetch_url function
This commit is contained in:
Adam Magness 2018-01-26 23:09:48 -05:00
parent 1b51777825
commit c67452f72e
25 changed files with 55 additions and 35 deletions

View file

@ -13,6 +13,7 @@ use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Model\Contact;
use Friendica\Util\Map;
use Friendica\Util\Network;
require_once 'include/event.php';
require_once 'mod/proxy.php';
@ -688,7 +689,7 @@ function GetProfileUsername($profile, $username, $compact = false, $getnetwork =
$StatusnetUser = preg_replace("=https?://(.*)/user/(.*)=ism", "$2", $profile);
if ($StatusnetUser != $profile) {
/// @TODO Some hosts run on https, not just http and sometimes http is disabled, let's support both here
$UserData = fetch_url("http://".$StatusnetHost."/api/users/show.json?user_id=".$StatusnetUser);
$UserData = Network::fetchURL("http://".$StatusnetHost."/api/users/show.json?user_id=".$StatusnetUser);
$user = json_decode($UserData);
if ($user) {
if ($getnetwork) {
@ -749,7 +750,7 @@ function bb_RemovePictureLinks($match) {
// if its not a picture then look if its a page that contains a picture link
require_once("include/network.php");
$body = fetch_url($match[1]);
$body = Network::fetchURL($match[1]);
$doc = new DOMDocument();
@$doc->loadHTML($body);
@ -806,7 +807,7 @@ function bb_CleanPictureLinksSub($match) {
// if its not a picture then look if its a page that contains a picture link
require_once("include/network.php");
$body = fetch_url($match[1]);
$body = Network::fetchURL($match[1]);
$doc = new DOMDocument();
@$doc->loadHTML($body);