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\Model\Contact;
use Friendica\Model\Profile;
use Friendica\Network\Probe;
use Friendica\Protocol\PortableContact;
use Friendica\Util\Network;
use dba;
use Exception;
@ -568,7 +569,7 @@ class GContact
$done[] = System::baseUrl() . '/poco';
if (strlen(Config::get('system', 'directory'))) {
$x = fetch_url(get_server()."/pubsites");
$x = Network::fetchURL(get_server()."/pubsites");
if ($x) {
$j = json_decode($x);
if ($j->entries) {

View file

@ -12,6 +12,7 @@ use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Object\Image;
use Friendica\Util\Network;
use dba;
require_once 'include/dba.php';
@ -101,7 +102,7 @@ class Photo
$photo_failure = false;
$filename = basename($image_url);
$img_str = fetch_url($image_url, true);
$img_str = Network::fetchURL($image_url, true);
if ($quit_on_error && ($img_str == "")) {
return false;

View file

@ -17,6 +17,7 @@ use Friendica\Model\Group;
use Friendica\Model\Photo;
use Friendica\Object\Image;
use Friendica\Util\Crypto;
use Friendica\Util\Network;
use dba;
use Exception;
@ -468,7 +469,7 @@ class User
$photo_failure = false;
$filename = basename($photo);
$img_str = fetch_url($photo, true);
$img_str = Network::fetchURL($photo, true);
// guess mimetype from headers or filename
$type = Image::guessType($photo, true);