refactor: safe PHP 7.4 modernization - #69
Draft
somethingwithproof wants to merge 8 commits into
Draft
Conversation
There was a problem hiding this comment.
Pull request overview
This PR modernizes the WebSeer plugin’s PHP code style (strict typing + short arrays) and adds initial security hardening scaffolding (audit docs, URL validator, tests, and CI config).
Changes:
- Add
declare(strict_types=1);across plugin entrypoints and supporting files, and refactor manyarray()usages to[](including prepared-statement parameter arrays). - Introduce security documentation and a new
UrlValidatorseam plus a new security-focused test file. - Add CI/static-analysis config (GitHub Actions, PHPUnit config, PHPStan config, Infection config).
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| webseer.php | Adds strict types; converts prepared-statement params and arrays to short syntax |
| webseer_servers.php | Adds strict types; converts prepared-statement params and arrays to short syntax |
| webseer_proxies.php | Adds strict types; converts arrays to short syntax |
| webseer_process.php | Adds strict types; converts prepared-statement params/arrays to short syntax |
| setup.php | Adds strict types; converts arrays/prepared-statement params to short syntax |
| poller_webseer.php | Adds strict types; converts prepared-statement params/arrays to short syntax |
| remote.php | Adds strict types; converts some arrays to short syntax; touches remote actions |
| includes/functions.php | Adds strict types; converts arrays to short syntax; touches remote-sync helpers |
| includes/arrays.php | Adds strict types; converts config/field definition arrays to short syntax |
| includes/constants.php | Adds strict types |
| includes/index.php | Adds strict types |
| index.php | Adds strict types |
| classes/cURL.php | Adds strict types; refactors some arrays and signature defaults |
| classes/mxlookup.php | Adds strict types; converts arrays to short syntax in class internals |
| classes/index.php | Adds strict types |
| images/index.php | Adds strict types |
| locales/index.php | Adds strict types |
| locales/po/index.php | Adds strict types |
| locales/LC_MESSAGES/index.php | Adds strict types |
| src/Security/UrlValidator.php | Adds SSRF-oriented URL validation helper + shim function |
| tests/Security/SsrfTest.php | Adds security regression/spec tests (Pest-style) |
| phpunit.xml | Adds PHPUnit configuration |
| phpstan.neon | Adds PHPStan configuration |
| infection.json | Adds Infection mutation-testing configuration |
| .github/workflows/ci.yml | Adds GitHub Actions workflow to run tests + PHPStan |
| SECURITY.md | Adds vulnerability disclosure policy |
| SECURITY-AUDIT.md | Adds detailed security audit findings and remediation notes |
| BACKLOG.md | Adds security hardening backlog and acceptance criteria |
| .omc/state/subagent-tracking.json | Adds tool state artifact (appears non-source) |
| .omc/state/checkpoints/checkpoint-2026-03-10T08-14-41-766Z.json | Adds tool checkpoint artifact (appears non-source) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
somethingwithproof
force-pushed
the
refactor/modernization
branch
from
April 10, 2026 05:59
a6dd110 to
d45bbaa
Compare
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
- Use inet_pton() to normalize IPv6 before checking loopback/link-local/ULA - Catch expanded notation like 0:0:0:0:0:0:0:1 as loopback - Detect IPv4-mapped IPv6 (::ffff:a.b.c.d) and check the inner v4 address - Resolve both A and AAAA records via dns_get_record so IPv6-only hosts aren't blocked as 'unresolvable' - Split IPv4/IPv6 internal checks into dedicated helpers Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
somethingwithproof
marked this pull request as draft
April 11, 2026 00:10
Member
Author
|
Converted to draft to serialize the stack in this repo. Blocked by #65; will un-draft after that merges to avoid cross-PR merge conflicts. |
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.
This PR adds strict typing, short array syntax, and null coalescing operators across the plugin. Standalone infrastructure files were removed per architectural mandate.