Skip to content

Fix. Code. Checking server settings#2

Merged
AntonV1211 merged 2 commits into
masterfrom
fix_vuln_av
May 28, 2026
Merged

Fix. Code. Checking server settings#2
AntonV1211 merged 2 commits into
masterfrom
fix_vuln_av

Conversation

@AntonV1211
Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown

Copilot AI left a comment

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 updates RemoteCalls::getSiteUrl() to sanitize the scheme/host/path derived from $_SERVER (including a fallback from SCRIPT_URL to REQUEST_URI) and adds PHPUnit coverage to validate sanitization behavior and the fallback logic.

Changes:

  • Harden RemoteCalls::getSiteUrl() by sanitizing HTTP_HOST and stripping unsafe characters from the URL path, with a fallback to REQUEST_URI when SCRIPT_URL is missing.
  • Add PHPUnit tests to verify sanitization of SCRIPT_URL and fallback parsing of REQUEST_URI.
  • Remove an incorrect @param $host from the perform() docblock.

Reviewed changes

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

File Description
RemoteCalls.php Sanitizes scheme/host/path when building the site URL and corrects the perform() docblock.
tests/RemoteCalls/RemoteCallsGetSiteUrlTest.php Adds unit tests for getSiteUrl() sanitization and fallback behavior.

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

Comment thread RemoteCalls.php Outdated
Comment thread RemoteCalls.php Outdated
Comment thread tests/RemoteCalls/RemoteCallsGetSiteUrlTest.php
@AntonV1211 AntonV1211 merged commit 14f12f8 into master May 28, 2026
1 check 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