From 7a04260b5f5f9e3a559a547141b61a6e50a46bf0 Mon Sep 17 00:00:00 2001 From: Nick Liu Date: Wed, 21 Jul 2021 20:23:06 +0200 Subject: [PATCH] #4299: Wrap even more potentially undefined constants In: * Admin-UI * Forums --- e107_handlers/admin_ui.php | 29 +++++++++++++++++++------- e107_plugins/forum/forum_class.php | 8 +++---- e107_plugins/forum/forum_viewtopic.php | 4 ++-- 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php index 3873a2613..3c7259963 100755 --- a/e107_handlers/admin_ui.php +++ b/e107_handlers/admin_ui.php @@ -7760,20 +7760,35 @@ class e_admin_form_ui extends e_form
"; $selectStart = "
- ".ADMIN_CHILD_ICON." + ".defset('ADMIN_CHILD_ICON')."
".$this->select_open('etrigger_batch', array('class' => 'tbox form-control input-large select batch e-autosubmit reset', 'id' => false)). ' - ' .$this->option(LAN_BATCH_LABEL_SELECTED, ''); + ' .$this->option(defset('LAN_BATCH_LABEL_SELECTED'), ''); $selectOpt = ''; if(!$this->getController()->getTreeModel()->isEmpty()) { - $selectOpt .= !empty($options['copy']) ? $this->option(LAN_COPY, 'copy', false, array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : ''; - $selectOpt .= !empty($options['delete']) ? $this->option(LAN_DELETE, 'delete', false, array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : ''; - $selectOpt .= !empty($options['export']) ? $this->option(LAN_UI_BATCH_EXPORT, 'export', false, array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : ''; - $selectOpt .= !empty($options['url']) ? $this->option(LAN_UI_BATCH_CREATELINK, 'url', false, array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : ''; - $selectOpt .= !empty($options['featurebox']) ? $this->option(LAN_PLUGIN_FEATUREBOX_BATCH, 'featurebox', false, array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : ''; + $selectOpt .= !empty($options['copy']) ? $this->option(defset('LAN_COPY'), + 'copy', + false, + array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : ''; + $selectOpt .= !empty($options['delete']) ? $this->option(defset('LAN_DELETE'), + 'delete', + false, + array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : ''; + $selectOpt .= !empty($options['export']) ? $this->option(defset('LAN_UI_BATCH_EXPORT'), + 'export', + false, + array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : ''; + $selectOpt .= !empty($options['url']) ? $this->option(defset('LAN_UI_BATCH_CREATELINK'), + 'url', + false, + array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : ''; + $selectOpt .= !empty($options['featurebox']) ? $this->option(defset('LAN_PLUGIN_FEATUREBOX_BATCH'), + 'featurebox', + false, + array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : ''; // if(!empty($parms['sef']) diff --git a/e107_plugins/forum/forum_class.php b/e107_plugins/forum/forum_class.php index 5524c70fc..fc9faa43d 100644 --- a/e107_plugins/forum/forum_class.php +++ b/e107_plugins/forum/forum_class.php @@ -315,10 +315,10 @@ class e107forum $postInfo['post_id'] = $this->postAdd($postInfo); // save it. - $postInfo['user_name'] = USERNAME; - $postInfo['user_email'] = USEREMAIL; - $postInfo['user_image'] = USERIMAGE; - $postInfo['user_signature'] = USERSIGNATURE; + $postInfo['user_name'] = defset('USERNAME'); + $postInfo['user_email'] = defset('USEREMAIL'); + $postInfo['user_image'] = defset('USERIMAGE'); + $postInfo['user_signature'] = defset('USERSIGNATURE'); if($_POST['insert'] == 1) { diff --git a/e107_plugins/forum/forum_viewtopic.php b/e107_plugins/forum/forum_viewtopic.php index e84ca11ca..ba0bbc2f6 100644 --- a/e107_plugins/forum/forum_viewtopic.php +++ b/e107_plugins/forum/forum_viewtopic.php @@ -365,14 +365,14 @@ $forumstring = $forstr . $forthr . vartrue($forrep) . $forend; //---- Orphan $currentUser??? $threadsViewed = explode(',', $currentUser['user_plugin_forum_viewed']); -if ($thread->threadInfo['thread_lastpost'] > USERLV && !in_array($thread->threadId, $threadsViewed)) +if ($thread->threadInfo['thread_lastpost'] > defset('USERLV') && !in_array($thread->threadId, $threadsViewed)) { $tst = $forum->threadMarkAsRead($thread->threadId); $mes->addDebug("Marking Forum as read: ".$thread->threadId." result: ".$tst); } else { - $ret = array('lastpost'=>$thread->threadInfo['thread_lastpost'], 'lastvisit'=>USERLV, 'thread'=>$thread->threadId, 'viewed'=>$threadsViewed); + $ret = array('lastpost'=>$thread->threadInfo['thread_lastpost'], 'lastvisit'=>defset('USERLV'), 'thread'=>$thread->threadId, 'viewed'=>$threadsViewed); e107::getDebug()->log($ret); unset($ret); }