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
// 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);
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];