From 5a53ffc28b0ea7112a36ccd90d041b6db0daa422 Mon Sep 17 00:00:00 2001 From: Martin Horsley <34482821+mchorsley@users.noreply.github.com> Date: Sat, 5 Jun 2021 21:38:11 +0100 Subject: [PATCH] Fixing #4284 - Parameters in array_key_exists (1.2.17 database upgrade) (#4285) * Fixing #4284 - Parameters in array_key_exists * Fixing issue #4284 - Database upgrade can fail - Uncaught argument count error * Fixing issue #4284 - Database upgrade can fail - Uncaught argument count error Co-authored-by: Mark Brugnoli-Vinten --- CHANGELOG | 3 ++- install/upgrades/1_2_17.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index a0c4b2e5b2..df50b7f777 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,7 @@ Cacti CHANGELOG -security#4261: Lack of escaping on file input fields can lead to XSS exposure under midwinter theme -security#4276: Lack of escaping on parameter graph_nolegend can lead to XSS exposure in graph_realtime.php -security#4282: Regenerate session id to avoid session fixation issue +-issue#4250: Unable to create graphs due to Data Source verification failure -issue#4254: When poller first runs, time since last run produces an error -issue#4259: A typo in variables.php leads to SQL error -issue#4263: Percentile not showing on partial data after fix for #3340 @@ -12,7 +13,7 @@ Cacti CHANGELOG -issue#4269: Installation Wizard - Uncaught Error: Call to undefined function cacti_snmp_session() -issue#4271: Continued timeout of registered processes -issue#4272: dns_get_record(): A temporary server error occurred --issue#4250: Unable to create graphs due to Data Source verification failure +-issue#4284: Database upgrade can fail - Uncaught argument count error -feature#4258: Update phpseclib to version 2.0.31 1.2.17 diff --git a/install/upgrades/1_2_17.php b/install/upgrades/1_2_17.php index 5bb857c7d8..2488bc4b65 100644 --- a/install/upgrades/1_2_17.php +++ b/install/upgrades/1_2_17.php @@ -173,14 +173,14 @@ function database_fix_mediumint_columns() { $table = $t['Tables_in_' . $database_default]; $columns = array(); - if (!array_key_exists($table, $tables, true)) { + if (!array_key_exists($table, $tables)) { $columns = array_rekey( db_fetch_assoc("SHOW COLUMNS FROM " . $table), 'Field', array('Type', 'Null', 'Key', 'Default', 'Extra') ); foreach($columns as $field => $attribs) { - if (array_key_exists($field, $known_columns, true)) { + if (array_key_exists($field, $known_columns)) { if (strpos($attribs['Type'], 'mediumint') === false) { if (strpos($attribs['Type'], 'int(10) unsigned') !== false) { continue;