Merge remote-tracking branch 'upstream/2021.03-rc' into issue-10019

This commit is contained in:
Michael 2021-03-13 12:30:41 +00:00
commit acffafe6b9
5 changed files with 28 additions and 7 deletions

View file

@ -26,6 +26,7 @@ use Friendica\BaseModule;
use Friendica\Core;
use Friendica\Core\Config\Cache;
use Friendica\Core\Renderer;
use Friendica\Core\Theme;
use Friendica\DI;
use Friendica\Network\HTTPException;
use Friendica\Util\BasePath;
@ -162,6 +163,16 @@ class Install extends BaseModule
}
self::$installer->installDatabase($configCache->get('system', 'basepath'));
// install allowed themes to register theme hooks
// this is same as "Reload active theme" in /admin/themes
$allowed_themes = Theme::getAllowedList();
$allowed_themes = array_unique($allowed_themes);
foreach ($allowed_themes as $theme) {
Theme::uninstall($theme);
Theme::install($theme);
}
Theme::setAllowedList($allowed_themes);
break;
}

View file

@ -127,13 +127,16 @@ class Proxy extends BaseModule
}
$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());
@ -153,7 +156,9 @@ class Proxy extends BaseModule
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);