Skip to content

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

Open
somethingwithproof wants to merge 9 commits into
Cacti:developfrom
somethingwithproof:hardening/comprehensive
Open

hardening: prepared statements, PHP 7.4 idioms, and security fixes#128
somethingwithproof wants to merge 9 commits into
Cacti:developfrom
somethingwithproof:hardening/comprehensive

Conversation

@somethingwithproof

@somethingwithproof somethingwithproof commented Apr 9, 2026

Copy link
Copy Markdown
Member

Hardens and modernizes ReportIt for PHP 7.4+.\n\n- Replace legacy isset() ternaries and assignment patterns with null coalescing operators.\n- Normalize report and archive request identifiers to integers.\n- Use those validated identifiers consistently in report table selection, filtering, and graph links.\n- Avoid variable shadowing in graph rendering.\n\nValidation:\n- PHP syntax check passes for view.php.

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 aims to modernize several PHP idioms (moving from isset()-ternaries to ?? and ??=) and improve safety around request-derived values in the ReportIt plugin UI paths.

Changes:

  • Replace isset(...) ? ... : ... patterns with null coalescing (??) across form and HTML helpers.
  • Replace “initialize-if-unset” patterns with the PHP 7.4 null coalescing assignment operator (??=) for session keys and defaults.
  • Introduce local request-var caching/casting in view.php for id/archive usage.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
view.php Introduces local $id/$archive variables for request handling, and uses them in parts of report rendering.
templates.php Refactors multiple isset ternaries to ?? and introduces ??= for template wizard/session defaults.
reportit.php Uses ??= for default tab/session template assignment and ?? for optional owner/report ID handling.
lib/funct_validate.php Uses ??= to initialize $_SESSION['sess_reportit'].
lib/funct_online.php Uses ??= to preserve first custom error message in session.
lib/funct_html.php Uses ?? for optional properties/values when composing HTML.

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

Comment thread view.php Outdated
Comment thread view.php Outdated
Comment thread view.php
@somethingwithproof
somethingwithproof force-pushed the hardening/comprehensive branch from 109e74f to c183de2 Compare July 14, 2026 10:47
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