Skip to content

Commit

Permalink
Fixing #4284 - Parameters in array_key_exists (1.2.17 database upgrad…
Browse files Browse the repository at this point in the history
…e) (#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 <netniv@hotmail.com>
  • Loading branch information
mchorsley and netniV committed Jun 5, 2021
1 parent 9c57201 commit 5a53ffc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions install/upgrades/1_2_17.php
Expand Up @@ -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;
Expand Down

0 comments on commit 5a53ffc

Please sign in to comment.