X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fproxy.php;h=ca8ced3cd6751292dd06c2b3b0198d0ce0d0b06c;hb=adacf421a66228948f8805d2310efdf01b5ceb93;hp=1497185917f1ea189195fbbf9dfb30289346d84d;hpb=c67452f72e34cfa94977dd8b6f4a8fdd09e79523;p=friendica.git diff --git a/mod/proxy.php b/mod/proxy.php index 1497185917..ca8ced3cd6 100644 --- a/mod/proxy.php +++ b/mod/proxy.php @@ -10,6 +10,7 @@ use Friendica\Core\System; 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 @@ -162,7 +163,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 = Network::fetchURL($_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); @@ -187,7 +188,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];