fix: guard SCRIPT_URL access in installer stats pixel#5778
Merged
Deltik merged 1 commit intoJun 17, 2026
Conversation
Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
Deltik
approved these changes
Jun 17, 2026
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.
Why
Fixes #5775. The installer's
stats()builds its phone-home URL from$_SERVER['SCRIPT_URL']directly. That variable is supplied by Apache mod_rewrite and is absent on the PHP built-in server, CLI, nginx, and some WAMP setups, so completing a fresh install logsUndefined array key "SCRIPT_URL"on PHP 8+.What Changed
Wrapped the read in
varset()so an absent key yields an empty string instead of warning, matching how the rest ofinstall.phpreads optional$_SERVER/step values.How It Was Tested
Traced the code path and lint-checked the file. The pixel still renders with an empty
urlwhen the key is missing, identical to the existing behavior on SAPIs that do set it.Backwards Compatibility
No BC impact. When
SCRIPT_URLis present the value is unchanged; only the missing-key warning is suppressed.Checklist
install.phpis the procedural installer and is not exercised by the unit suite; the adjacent help-text guard in fix: avoid undefined array key in admin help e_QUERY parsing #5773 shipped without a test for the same reason