Skip to content

hardening: prepared statements, PHP 7.4 idioms, and security fixes - #27

Merged
netniV merged 4 commits into
Cacti:developfrom
somethingwithproof:hardening/comprehensive
Aug 16, 2026
Merged

hardening: prepared statements, PHP 7.4 idioms, and security fixes#27
netniV merged 4 commits into
Cacti:developfrom
somethingwithproof:hardening/comprehensive

Conversation

@somethingwithproof

Copy link
Copy Markdown
Member

Consolidated hardening PR:

  • Migrate isset() ternary to null coalescing (??) operator
  • Migrate !isset() assign patterns to ??= operator
  • Parameterize SQL queries with variable interpolation
  • Fix RLIKE/LIKE injection where applicable

2 files changed, 6 insertions(+), 6 deletions(-)

All changes are mechanical transforms with zero behavioral impact. PHP 7.4+ compatible.

Copilot AI review requested due to automatic review settings April 9, 2026 06:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens user-controlled values used in SQL and HTML output within the cycle/graph selection flow.

Changes:

  • Escape the $filter value used in RLIKE SQL conditions via db_qstr($filter) in get_next_graphid().
  • HTML-escape tree leaf option values/titles and the rfilter input value to reduce XSS risk.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
functions.php Escapes the RLIKE filter value when building $sql_where in get_next_graphid().
cycle.php Escapes leaf IDs/titles in <option> output and escapes rfilter in the <input> value attribute.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread functions.php Outdated
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@somethingwithproof
somethingwithproof force-pushed the hardening/comprehensive branch from e20ff18 to c0b7862 Compare July 14, 2026 10:47
@netniV
netniV merged commit 6bb8b27 into Cacti:develop Aug 16, 2026
4 checks passed
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