Document get_filter_request_var()/gfrv() (int) cast rule - #388
Open
TheWitness wants to merge 1 commit into
Open
TheWitness wants to merge 1 commit into
TheWitness wants to merge 1 commit into
Conversation
…st to (int) for string output
Contributor
There was a problem hiding this comment.
🟢 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:171requires all changes to be recorded inCHANGELOG.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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a short note to
.github/copilot-instructions.mdunder the Input Validation section: whenget_filter_request_var()(or itsgfrv()shorthand) is called with only the$nameargument,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.