Fix miscellaneous errors in PHP 8.0

https://xetown.com/questions/1494606
This commit is contained in:
Kijin Sung 2020-12-21 01:01:26 +09:00
parent 7e54b3add5
commit 198bb1b079
4 changed files with 14 additions and 6 deletions

View file

@ -60,7 +60,7 @@ class fileAdminController extends file
function procFileAdminInsertUploadConfig()
{
// Update configuration
$config = getModel('module')->getModuleConfig('file');
$config = getModel('module')->getModuleConfig('file') ?: new stdClass;
$config->allowed_filesize = Context::get('allowed_filesize');
$config->allowed_attach_size = Context::get('allowed_attach_size');
$config->allowed_filetypes = Context::get('allowed_filetypes');
@ -126,7 +126,7 @@ class fileAdminController extends file
function procFileAdminInsertDownloadConfig()
{
// Update configuration
$config = getModel('module')->getModuleConfig('file');
$config = getModel('module')->getModuleConfig('file') ?: new stdClass;
$config->allow_outlink = Context::get('allow_outlink') === 'N' ? 'N' : 'Y';
$config->allow_outlink_format = Context::get('allow_outlink_format');
$config->allow_outlink_site = Context::get('allow_outlink_site');
@ -148,7 +148,7 @@ class fileAdminController extends file
function procFileAdminInsertOtherConfig()
{
// Update configuration
$config = getModel('module')->getModuleConfig('file');
$config = getModel('module')->getModuleConfig('file') ?: new stdClass;
$config->save_changelog = Context::get('save_changelog') === 'Y' ? 'Y' : 'N';
// Save and redirect