Make WordPress Core

Opened 19 years ago

Closed 19 years ago

Last modified 9 years ago

#5114 closed enhancement (fixed)

wp_safe_redirect() case sensitive for hostnames

Reported by: BoltClock Owned by:
Priority: normal Milestone: 2.3.1
Component: General Version: 2.3
Severity: normal Keywords: has-patch needs-testing
Cc: Focuses:

Description

For instance, when I enter a post password, no matter whether it was correct, I get redirected to my wp-admin folder instead of the form's page. I had set my hostname to contain uppercase letters as an experiment.

Exploring the source code made it apparent that the check in wp_safe_redirect() is case sensitive, i.e. hostname ​http://www.EXAMPLE.com does not match ​http://www.example.com.

Attachments (3)

pluggable.php.diff​ (665 bytes ) - added by BoltClock 19 years ago.
5114.2.diff​ (640 bytes ) - added by markjaquith 19 years ago.
5114.3.diff​ (594 bytes ) - added by markjaquith 19 years ago.

Download all attachments as: .zip

Change History (13)

#1 @BoltClock
19 years ago

  • Type defect → enhancement

#2 @BoltClock
19 years ago

  • Keywords 2nd-opinion needs-testing added; dev-feedback removed

#3 @westi
19 years ago

  • Keywords has-patch added; 2nd-opinion removed

#4 @markjaquith
19 years ago

  • Milestone 2.3.1 → 2.4

5114.2.diff adds a strtolower()'d version of the host into the allowed_hosts array. So you can match by being lowercase or by matching exactly. Milestone of 2.4 before 2.3.1

#5 @markjaquith
19 years ago

5114.3.diff only does the strtolower() if the raw version doesn't match.

#6 @markjaquith
19 years ago

  • Resolution → fixed
  • Status new → closed

(In [6219]) check for a match against a lowercase host in wp_safe_redirect(). props BoltClock. fixes #5114 for trunk

#7 @markjaquith
19 years ago

  • Milestone 2.4 → 2.3.1
  • Resolution fixed
  • Status closed → reopened

#8 @markjaquith
19 years ago

  • Resolution → fixed
  • Status reopened → closed

(In [6220]) check for a match against a lowercase host in wp_safe_redirect(). props BoltClock. fixes #5114 for 2.3.1

#9 @jorbin
11 years ago

In 36445:

Revert [35792]

This causes a regression and causes redirects to potentially fail.

See #5114 #34028
props ocean90

This ticket was mentioned in ​Slack in #mobile by suhankoh. ​View the logs.


9 years ago

Note: See TracTickets for help on using tickets.