use Friendica\App;
use Friendica\BaseModule;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Model\Photo;
$thumb = false;
$size = 1024;
$sizetype = '';
- $basepath = $a->get_basepath();
+ $basepath = $a->getBasePath();
// If the cache path isn't there, try to create it
if (!is_dir($basepath . '/proxy') && is_writable($basepath)) {
$direct_cache = false;
}
+ if (empty($_REQUEST['url'])) {
+ System::httpExit(400, ["title" => L10n::t('Bad Request.')]);
+ }
+
if (!$direct_cache) {
$urlhash = 'pic:' . sha1($_REQUEST['url']);
unlink($tempfile);
// If there is an error then return a blank image
- if ((substr($a->get_curl_code(), 0, 1) == '4') || (!$img_str)) {
+ if ((substr(Network::getCurl()->getCode(), 0, 1) == '4') || (!$img_str)) {
$img_str = file_get_contents('images/blank.png');
$mime = 'image/png';
$cachefile = ''; // Clear the cachefile so that the dummy isn't stored