Skip to content

fix(device-rules): validate 'action' before first read - #435

Merged
TheWitness merged 1 commit into
developfrom
fix/device-rules-action-validation
Nov 7, 2026
Merged

TheWitness merged 1 commit into
developfrom
fix/device-rules-action-validation

Conversation

@TheWitness

Copy link
Copy Markdown
Member

syslog_device_rules.php read get_request_var('action') for the
ajax_hosts early-return before set_default_action() ran, so Cacti logged
"Input Validation Not Performed for 'action'". Cacti's check_all_pages CI
crawl treats that log line as a failure.

Move set_default_action() above the first action read so the request var
is registered/validated before use. No behavior change otherwise.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

syslog_device_rules.php read get_request_var('action') for the
ajax_hosts early-return before set_default_action() ran, so Cacti logged
"Input Validation Not Performed for 'action'". Cacti's check_all_pages CI
crawl treats that log line as a failure.

Move set_default_action() above the first action read so the request var
is registered/validated before use. No behavior change otherwise.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 7, 2026 18:52
@sonarqubecloud

sonarqubecloud Bot commented Nov 7, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the change that initializes action before its first read.

No open issues 🎉

What changed in this PR

Moves action initialization before the first request-variable read in the device-rules page, preventing Cacti’s input-validation warning that causes the CI page crawl to fail.

Changes:

  • Calls set_default_action() before the ajax_hosts early-return check.
  • Removes the later call before action dispatch, leaving the remaining logic unchanged.
File Description
syslog_device_rules.php Initializes and validates action before its first read.

Review effort: Balanced

@TheWitness
TheWitness merged commit aef9698 into develop Nov 7, 2026
7 checks passed
@TheWitness
TheWitness deleted the fix/device-rules-action-validation branch November 7, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants