WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 15 months ago

#33821 new defect (bug)

redirect_canonical does not consider port in $compare_original — at Initial Version

Reported by: willshouse Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 2.3
Component: Canonical Keywords: has-patch needs-unit-tests needs-testing
Focuses: Cc:

Description

In the wp-includes/canonical.php file the $requested_url is built starting at line 64. It combines is_ssl() for protocol, $_SERVERHTTP_HOST?, and $_SERVERREQUEST_URI? - but it does not consider $_SERVERSERVER_PORT?

This causes a redirect loop for us because we run HTTPS on port 8443.

I suggest checking to see if a port other than 80 or 443 is being used and adding that as part of the comparison - suggested patch attached.

Change History (1)

@willshouse
5 years ago

add canonical port check

Note: See TracTickets for help on using tickets.