From eee039b616948ec6dd6dd01c3e61dbf98a884c7c Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 29 Jan 2021 20:11:49 -0800 Subject: [PATCH] PHP8/Bootstrap5 Fixes --- e107_handlers/form_handler.php | 7 ++++++- e107_handlers/pref_class.php | 5 +++++ e107_handlers/sitelinks_class.php | 4 +--- e107_plugins/chatbox_menu/chat.php | 6 ++++-- .../forum/shortcodes/batch/viewforum_shortcodes.php | 4 ++-- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index 831776a18..7dbe817c6 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -986,7 +986,7 @@ class e_form * @param $ajax * @return string */ - public function iconpicker($name, $default, $label, $options = array(), $ajax = true) + public function iconpicker($name, $default, $label='', $options = array(), $ajax = true) { //v2.2.0 unset($label,$ajax); // no longer used. @@ -4064,6 +4064,11 @@ var_dump($select_options);*/ return ''; } + if(is_array($value)) + { + $value = null; + } + //format data first $name = trim($this->name2id($name), '-'); $value = trim(preg_replace('#[^a-zA-Z0-9\-]#', '-', $value), '-'); diff --git a/e107_handlers/pref_class.php b/e107_handlers/pref_class.php index 528075dc7..0f06bfd75 100644 --- a/e107_handlers/pref_class.php +++ b/e107_handlers/pref_class.php @@ -577,6 +577,11 @@ class e_pref extends e_front_model // $log->logArrayDiffs($new, $old, 'PREFS_02', false); $log->addArray($new,$old); unset($new, $old); + if(deftrue('e_DEBUG')) + { + $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS,2); + $log->logMessage(print_a($backtrace,true), E_MESSAGE_DEBUG); + } } diff --git a/e107_handlers/sitelinks_class.php b/e107_handlers/sitelinks_class.php index 54e153d01..e97d79389 100644 --- a/e107_handlers/sitelinks_class.php +++ b/e107_handlers/sitelinks_class.php @@ -1411,9 +1411,7 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; } $srch = array('{ICON}', '{CAPTION}'); $repl = array(varset($extraParms['icon']), $title); - $title = str_replace($srch,$repl, $tmpl['caption']); - - + $title = str_replace($srch,$repl, varset($tmpl['caption'])); $ret = $ns->tablerender($title, $text, 'default', true); $ns->setUniqueId(null); diff --git a/e107_plugins/chatbox_menu/chat.php b/e107_plugins/chatbox_menu/chat.php index 849e7cb9a..9bbfa719a 100755 --- a/e107_plugins/chatbox_menu/chat.php +++ b/e107_plugins/chatbox_menu/chat.php @@ -35,8 +35,10 @@ if($sql->select('menus', "*", "menu_name='chatbox_menu'")) if ( ! isset($pref['cb_mod'])) { $pref['cb_mod'] = e_UC_ADMIN; } - -define('CB_MOD', check_class($pref['cb_mod'])); +if(!defined('CB_MOD')) +{ + define('CB_MOD', check_class($pref['cb_mod'])); +} if ( ! empty($_POST['moderate']) && CB_MOD) { diff --git a/e107_plugins/forum/shortcodes/batch/viewforum_shortcodes.php b/e107_plugins/forum/shortcodes/batch/viewforum_shortcodes.php index ba5c9317d..42fb4f2ba 100644 --- a/e107_plugins/forum/shortcodes/batch/viewforum_shortcodes.php +++ b/e107_plugins/forum/shortcodes/batch/viewforum_shortcodes.php @@ -1157,11 +1157,11 @@ ); - $text .= "
  • " . LAN_DELETE . " " . $tp->toGlyph('trash') . "
  • "; + $text .= "
  • " . LAN_DELETE . " " . $tp->toGlyph('fa-trash') . "
  • "; $text .= "
  • " . $lan[$stickUnstick] . " " . $icon[$stickUnstick] . "
  • "; $text .= "
  • " . $lan[$lockUnlock] . " " . $icon[$lockUnlock] . "
  • "; - $text .= "
  • " . LAN_FORUM_2042 . " " . $tp->toGlyph('move') . "
  • "; + $text .= "
  • " . LAN_FORUM_2042 . " " . $tp->toGlyph('fa-arrows') . "
  • "; //if(e_DEVELOPER) // {