From 4dcdb9e4bda8d8e65225eb3242eda2bf379a9b3c Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Fri, 8 Jan 2021 00:27:00 +0900 Subject: [PATCH] Fix various warnings in PHP 8.0 --- classes/context/Context.class.php | 2 +- modules/document/document.controller.php | 2 +- modules/document/document.item.php | 7 ++++++- modules/document/document.model.php | 2 +- modules/editor/editor.model.php | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index 210304486..160082ccf 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -2293,7 +2293,7 @@ class Context $plugin_name = 'ui'; } - if($loaded_plugins[$plugin_name]) + if(isset($loaded_plugins[$plugin_name])) { return; } diff --git a/modules/document/document.controller.php b/modules/document/document.controller.php index 7b5022a42..2e462bbd4 100644 --- a/modules/document/document.controller.php +++ b/modules/document/document.controller.php @@ -1355,7 +1355,7 @@ class documentController extends document $oDB->commit(); // Register session - if(!$_SESSION['banned_document'][$document_srl] && Context::getSessionStatus()) + if(!isset($_SESSION['readed_document'][$document_srl]) && Context::getSessionStatus()) { $_SESSION['readed_document'][$document_srl] = true; } diff --git a/modules/document/document.item.php b/modules/document/document.item.php index 111cee45f..51f07c870 100644 --- a/modules/document/document.item.php +++ b/modules/document/document.item.php @@ -30,6 +30,11 @@ class documentItem extends BaseObject * @var bool */ var $allow_trackback_status = null; + /** + * Comment page navigation + * @var object + */ + var $comment_page_navigation = null; /** * column list * @var array @@ -1459,7 +1464,7 @@ class documentItem extends BaseObject if(!isset($GLOBALS['__member_signature_max_height'])) { $member_config = ModuleModel::getModuleConfig('member'); - $GLOBALS['__member_signature_max_height'] = $member_config->signature_max_height; + $GLOBALS['__member_signature_max_height'] = $member_config->signature_max_height ?? 100; } if($signature) { diff --git a/modules/document/document.model.php b/modules/document/document.model.php index 1aa5c0367..bcdbd99d1 100644 --- a/modules/document/document.model.php +++ b/modules/document/document.model.php @@ -1307,7 +1307,7 @@ class documentModel extends document $args->page_count = $searchOpt->page_count ?? 10; $args->start_date = $searchOpt->start_date ?? null; $args->end_date = $searchOpt->end_date ?? null; - $args->s_is_notice = $searchOpt->except_notice ? 'N' : null; + $args->s_is_notice = ($searchOpt->except_notice ?? false) ? 'N' : null; $args->statusList = $searchOpt->statusList ?? array(self::getConfigStatus('public'), self::getConfigStatus('secret')); $args->columnList = $searchOpt->columnList ?? array(); diff --git a/modules/editor/editor.model.php b/modules/editor/editor.model.php index 9f6b4126c..9d98cdf79 100644 --- a/modules/editor/editor.model.php +++ b/modules/editor/editor.model.php @@ -262,7 +262,7 @@ class editorModel extends editor Context::set('files_count', (int)$files_count); // Check an option whether to start the editor manually. - Context::set('editor_manual_start', $option->manual_start); + Context::set('editor_manual_start', $option->manual_start ?? null); // Compile and return the editor skin template. $tpl_path = Context::get('editor_path');