Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing #4284 - Parameters in array_key_exists (1.2.17 database upgrade) #4285

Merged
merged 4 commits into from
Jun 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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