Skip to content

Document get_filter_request_var()/gfrv() (int) cast rule - #388

Open
TheWitness wants to merge 1 commit into
developfrom
cleanup/int-cast-get-filter-request-var
Open

TheWitness wants to merge 1 commit into
developfrom
cleanup/int-cast-get-filter-request-var

Conversation

@TheWitness

Copy link
Copy Markdown
Member

Summary

Adds a short note to .github/copilot-instructions.md under the Input Validation section: when
get_filter_request_var() (or its gfrv() shorthand) is called with only the $name argument,
it already validates the value as numeric, returns it as a string, and halts execution on
non-numeric input. So casting its output to (int) before using it only for string output
(print/echo/string concatenation) is redundant. This mirrors a rule adopted in
Cacti/plugin_flowview.

Test plan

Doc-only change; no code paths affected.

Copilot AI lite review requested due to automatic review settings September 16, 2026 13:41

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

The doc-only change is scoped; the remaining changelog item is a minor nit.

Pull request overview

Documents the numeric validation and string-return behavior of get_filter_request_var()/gfrv().

Changes:

  • Clarifies when (int) casts are redundant.
  • Notes when numeric operations still require casting.
File summaries
File Description
.github/copilot-instructions.md Adds input-validation casting guidance.
Review details

Suppressed comments (1)

.github/copilot-instructions.md:88

  • The repository guidance at .github/copilot-instructions.md:171 requires all changes to be recorded in CHANGELOG.md, but this documentation update has no corresponding changelog entry. Please add a --- develop --- bullet describing this rule so the project history stays complete.
`get_filter_request_var()` (and its `gfrv()` shorthand, where available) called with only the
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

2 participants