WordPress.org

Make WordPress Core

Opened 14 months ago

Closed 7 weeks ago

#49085 closed defect (bug) (wontfix)

add_query_arg does not use WP_HOME or WP_SITEURL

Reported by: lonevvolf Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

Plugins which use add_query_arg are producing invalid links when the website is hosted behind a reverse proxy with a different path than the installed application. While the domain name is correct, the path is wrong.

Change History (3)

#1 @lonevvolf
14 months ago

Also, PATH_CURRENT_SITE could be utilized here for perhaps a more straightforward fix.

This ticket was mentioned in Slack in #core by peterwilsoncc. View the logs.


7 weeks ago

#3 @peterwilsoncc
7 weeks ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Hi @lonevvolf and welcome to Trac!

Due to the variety of configurations available for sites served behind a reverse proxy, the usual recommendation is for site owners to mess with the $_SERVER values in the wp-config.php file.

In add_query_arg() the default has been to assume the current URL for around 16 years, and determining that without system knowledge behind a reverse proxy is borderline impossible (is / served from /cms/ on the proxy, etc).

I'm going to close this off as wontfix, which is the term used on trac for tickets that won't have action taken on them.

Thansk.

Note: See TracTickets for help on using tickets.