hardening: prepared statements, PHP 7.4 idioms, and security fixes - #128
Open
somethingwithproof wants to merge 9 commits into
Open
hardening: prepared statements, PHP 7.4 idioms, and security fixes#128somethingwithproof wants to merge 9 commits into
somethingwithproof wants to merge 9 commits into
Conversation
There was a problem hiding this comment.
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.phpforid/archiveusage.
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.
somethingwithproof
force-pushed
the
hardening/comprehensive
branch
from
April 9, 2026 09:00
e0bb110 to
343dc68
Compare
This was referenced Apr 11, 2026
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
somethingwithproof
force-pushed
the
hardening/comprehensive
branch
from
July 14, 2026 10:47
109e74f to
c183de2
Compare
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
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.
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.