From 748e5ee11d33c2deff57d3480052a6dd7cb8dd14 Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 25 Jan 2021 09:14:45 -0800 Subject: [PATCH] Issue #3902 PHP Notice and Error fixes. --- e107_handlers/bbcode_handler.php | 2 +- e107_handlers/sitelinks_class.php | 7 ++++++- install.php | 12 ++++++------ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/e107_handlers/bbcode_handler.php b/e107_handlers/bbcode_handler.php index 23475afce..9811fb202 100644 --- a/e107_handlers/bbcode_handler.php +++ b/e107_handlers/bbcode_handler.php @@ -37,7 +37,7 @@ class e_bbcode { $pref = e107::getPref(); - $this->resizePrefs = $pref['resize_dimensions']; + $this->resizePrefs = varset($pref['resize_dimensions']); $this->core_bb = array( 'alert', diff --git a/e107_handlers/sitelinks_class.php b/e107_handlers/sitelinks_class.php index 4fdec076b..218ca3b14 100644 --- a/e107_handlers/sitelinks_class.php +++ b/e107_handlers/sitelinks_class.php @@ -1605,7 +1605,12 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; } { foreach($tmp as $val) { - $tmp2 = (array) $val['link_sub']; + if(!is_array($val)) + { + continue; + } + + $tmp2 = $val['link_sub']; unset($val['link_sub']); $newArr[] = $val; if(!empty($tmp2)) diff --git a/install.php b/install.php index 30db3a577..7842349be 100644 --- a/install.php +++ b/install.php @@ -256,14 +256,14 @@ if(isset($_POST['previous_steps'])) $tmp = unserialize(base64_decode($_POST['previous_steps'])); // Save unfiltered admin password (#4004) - " are transformed into " - $tmpadminpass1 = !empty($tmp['admin']['password']) ? $tmp['admin']['password'] : ''; + $tmpadminpass1 = (isset($tmp['admin']) && !empty($tmp['admin']['password'])) ? $tmp['admin']['password'] : ''; $tmp = filter_var_array($tmp, FILTER_SANITIZE_STRING); // Restore unfiltered admin password $tmp['admin']['password'] = $tmpadminpass1; - $override = (isset($tmp['paths']['hash'])) ? array('site_path'=>$tmp['paths']['hash']) : array(); + $override = (isset($tmp['paths']) && isset($tmp['paths']['hash'])) ? array('site_path'=>$tmp['paths']['hash']) : array(); unset($tmp); unset($tmpadminpass1); } @@ -389,7 +389,7 @@ class e_install $this->previous_steps = unserialize(base64_decode($_POST['previous_steps'])); // Save unfiltered admin password (#4004) - " are transformed into " - $tmpadminpass2 = $this->previous_steps['admin']['password']; + $tmpadminpass2 = (isset($this->previous_steps['admin'])) ? $this->previous_steps['admin']['password'] : ''; $this->previous_steps = $tp->filter($this->previous_steps); @@ -1050,7 +1050,7 @@ class e_install $this->add_button("retest_perms", LANINS_009); $this->stage = 3; // make the installer jump back a step } - elseif ($perms_pass && !$version_fail && ($extensionCheck['xml']['status'] == true)) + elseif (!$version_fail && ($extensionCheck['xml']['status'] == true)) { $this->add_button("continue_install", LAN_CONTINUE); } @@ -2369,7 +2369,7 @@ class SimpleTemplate 'Data' => $Data ); } - +/* function RemoveTag($TagName) { unset($this->Tags[$TagName]); @@ -2378,7 +2378,7 @@ class SimpleTemplate function ClearTags() { $this->Tags = array(); - } + }*/ function ParseTemplate($Template, $template_type = TEMPLATE_TYPE_FILE) {