<?php
/**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
}
$basepath = $a->getBasePath();
+ $filepermission = DI::config()->get('system', 'proxy_file_chmod');
// Store original image
if ($direct_cache) {
// direct cache , store under ./proxy/
$filename = $basepath . '/proxy/' . ProxyUtils::proxifyUrl($request['url'], true);
file_put_contents($filename, $image->asString());
- chmod($filename, DI::config()->get('system', 'proxy_file_chmod'));
+ if (!empty($filepermission)) {
+ chmod($filename, $filepermission);
+ }
} elseif($cachefile !== '') {
// cache file
file_put_contents($cachefile, $image->asString());
if ($direct_cache && $request['sizetype'] != '') {
$filename = $basepath . '/proxy/' . ProxyUtils::proxifyUrl($request['url'], true) . $request['sizetype'];
file_put_contents($filename, $image->asString());
- chmod($filename, DI::config()->get('system', 'proxy_file_chmod'));
+ if (!empty($filepermission)) {
+ chmod($filename, $filepermission);
+ }
}
self::responseImageHttpCache($image);