Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function audit_poller_bottom() {
$retention = read_config_option('audit_retention');

if ($retention > 0) {
db_execute('DELETE FROM audit_log WHERE event_time < FROM_UNIXTIME(' . (time() - ($retention * 86400)) . ')');
db_execute_prepared('DELETE FROM audit_log WHERE event_time < FROM_UNIXTIME(?)', array(time() - ($retention * 86400)));
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description says it migrates the remaining interpolated SQL queries to prepared statements, but this file still has variable-interpolated UPDATEs to plugin_config (e.g., SET version='$current' and string-concatenated name/author/webpage updates in audit_check_upgrade()). Either convert those to prepared statements as well, or adjust the PR description/scope so it matches the actual change set.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. Only the one query with variable interpolation was converted. The others are static SQL.

$rows = db_affected_rows();
cacti_log('NOTE: Purged ' . $rows . ' Audit Log Records from Cacti', false, 'POLLER');
}
Expand Down
Loading