mirror of
https://github.com/friendica/friendica
synced 2025-04-22 12:30:12 +00:00
Move fetch_url
move fetch_url function
This commit is contained in:
parent
1b51777825
commit
c67452f72e
25 changed files with 55 additions and 35 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue