Admin: Avoid using HTTP_HOST to build admin URLs.#11709
Admin: Avoid using HTTP_HOST to build admin URLs.#11709himanshupathak95 wants to merge 6 commits intoWordPress:trunkfrom
HTTP_HOST to build admin URLs.#11709Conversation
96e424e to
9adfb38
Compare
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
9adfb38 to
2dcb0aa
Compare
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Trac ticket: https://core.trac.wordpress.org/ticket/16858
WordPress admin constructz the "current URL" by manually concatenating
$_SERVER['HTTP_HOST']with$_SERVER['REQUEST_URI']these places:WP_List_Table::pagination()— pagination navigation linksWP_List_Table::print_column_headers()— column sort linkswp_admin_canonical_url()— the admin canonical<link>tagWhen WordPress runs behind a reverse proxy,
HTTP_HOSTreflects the internal backend hostname, notthe public-facing WordPress URL, causing these links to point to the wrong host.
Testing
Run tests by -
Use of AI Tools
AI assistance: Yes
Tool(s): ChatGPT
Model(s): GPT-5.1
Used for: Unit tests review
Props dd32