X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fproxy.php;h=6dc396787664ff64211f5d3c9a4bc2987a6be7fe;hb=5c63de1692c5be4ca457e03fc037683909a44348;hp=538275ef00f9e1a84c293e97156418b71b31a02d;hpb=e36f2bb1fb3439e9993c7568e57140c4f954b772;p=friendica.git diff --git a/mod/proxy.php b/mod/proxy.php index 538275ef00..6dc3967876 100644 --- a/mod/proxy.php +++ b/mod/proxy.php @@ -7,9 +7,12 @@ use Friendica\App; use Friendica\Core\Config; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Photo; use Friendica\Object\Image; +use Friendica\Util\DateTimeFormat; +use Friendica\Util\Network; define('PROXY_DEFAULT_TIME', 86400); // 1 Day @@ -161,7 +164,7 @@ function proxy_init(App $a) { // It shouldn't happen but it does - spaces in URL $_REQUEST['url'] = str_replace(' ', '+', $_REQUEST['url']); $redirects = 0; - $img_str = fetch_url($_REQUEST['url'], true, $redirects, 10); + $img_str = Network::fetchUrl($_REQUEST['url'], true, $redirects, 10); $tempfile = tempnam(get_temppath(), 'cache'); file_put_contents($tempfile, $img_str); @@ -186,7 +189,7 @@ function proxy_init(App $a) { die(); } - $fields = ['uid' => 0, 'contact-id' => 0, 'guid' => get_guid(), 'resource-id' => $urlhash, 'created' => datetime_convert(), 'edited' => datetime_convert(), + $fields = ['uid' => 0, 'contact-id' => 0, 'guid' => System::createGUID(), 'resource-id' => $urlhash, 'created' => DateTimeFormat::utcNow(), 'edited' => DateTimeFormat::utcNow(), 'filename' => basename($_REQUEST['url']), 'type' => '', 'album' => '', 'height' => imagesy($image), 'width' => imagesx($image), 'datasize' => 0, 'data' => $img_str, 'scale' => 100, 'profile' => 0, 'allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '', 'desc' => $mime];