refactor: safe PHP 7.4 modernization - #54
Draft
somethingwithproof wants to merge 8 commits into
Draft
Conversation
There was a problem hiding this comment.
Pull request overview
This PR modernizes the Cacti Audit plugin’s PHP sources by enabling strict typing and updating some legacy array syntax, with the goal of safer/cleaner PHP 7.4-era code.
Changes:
- Added
declare(strict_types=1);to multiple PHP entrypoint files. - Converted some
array(...)usages to short array syntax[...]. - Introduced additional input/type guarding in
audit_process_page_data().
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.php | Adds strict types and short array syntax; currently contains a PHP parse error in audit_utilities_array declaration. |
| audit.php | Adds strict types and short array syntax; currently contains PHP parse errors in is_array checks. |
| audit_functions.php | Adds strict types, short array syntax, and new guard logic; currently contains a PHP parse error in the guard clause. |
| index.php | Adds strict types to plugin index redirect. |
| locales/index.php | Adds strict types to locales index redirect. |
| locales/LC_MESSAGES/index.php | Adds strict types to LC_MESSAGES index redirect. |
| .omc/sessions/*.json | Adds session metadata files that appear unrelated to plugin runtime and should not be committed. |
somethingwithproof
marked this pull request as draft
April 11, 2026 00:09
Member
Author
|
Converted to draft to serialize the stack in this repo. Blocked by #51; will un-draft after that merges to avoid cross-PR merge conflicts. |
Guard against non-string $page and non-array $selected_items at the function boundary to prevent unexpected behavior from malformed caller data. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Revert corrupted function calls introduced by refactoring tool: - is_[$x] -> is_array($x) - in_[$x, ...] -> in_array($x, ...) - xml2[$x] -> xml2array($x) Also remove accidentally committed .omc session files and add .omc/ to .gitignore. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
somethingwithproof
force-pushed
the
refactor/modernization
branch
from
July 14, 2026 10:46
139f88d to
766ffda
Compare
# Conflicts: # .github/workflows/plugin-ci-workflow.yml # .gitignore # audit.php # audit_functions.php # setup.php
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.
This PR adds strict typing, short array syntax, and null coalescing operators across the plugin. Standalone infrastructure files were removed per architectural mandate.