Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#20750 closed defect (bug) (duplicate)

home_url() $scheme parameter fails when site URL uses SSL

Reported by: johnbillion Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.3
Component: General Keywords: has-patch
Focuses: Cc:


Steps to reproduce:

  1. Go into General Settings and set your WordPress Address and Site Address to use SSL (eg. https://example.com).
  2. Output a link somewhere using home_url() with the $scheme parameter set to 'http'. Example:
echo home_url( '/', 'http' );

Expected output: http://example.com.

Actual output: https://example.com.

The inverse of course works as expected, if your site uses an HTTP URL and you pass 'https' as the $scheme parameter you'll end up with https://example.com.

Seen in 3.3, probably occurs in earlier versions.

Attachments (2)

20750.patch (582 bytes) - added by johnbillion 8 years ago.
20750.2.patch (1015 bytes) - added by SergeyBiryukov 8 years ago.

Download all attachments as: .zip

Change History (5)

8 years ago

#1 @johnbillion
8 years ago

  • Keywords has-patch added

#2 @johnbillion
8 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

I'm going to close this as #20759 will address this issue by switching to the new set_url_scheme() function.

#3 @SergeyBiryukov
8 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.