[2.x] Persist non-standard ports in site URL #16201
Merged
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.
What does it do?
Ensures that non-standard ports persist in the site_url.
Why is it needed?
Currently, when using a non-standard port for https (any one other than 443), the port gets stripped from the site's URL, making it impossible to properly navigate the site. Only the standard ports of 80 and 443 should be stripped.
How to test
Configure the testing site on standard and non-standard ports, both with https on and off. Verify that setup, subsequent usage of the manager, and front end browsing all work as expected (with non-standard ports being maintained in the URL and 80/443 being stripped out).
Related issue(s)/PR(s)
This is a backport of #16087 (which solved #16015 for 3.x).