Make WordPress Core

Opened 10 years ago

Closed 6 years ago

Last modified 6 years ago

#35196 closed task (blessed) (wontfix)

Unit tests for URL schemes

Reported by: johnbillion's profile johnbillion Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords: https has-patch bulk-reopened
Focuses: Cc:

Description

In order to tackle various HTTPS related issues, it would be ideal to have test coverage for the schemes of URLs returned by the URL-generating functions under various conditions.

For example, we know that admin_url() should always return a URL with an https scheme when FORCE_SSL_ADMIN is true. However the scheme in the URL returned by home_url() varies depending on the current request's scheme as well as the home option's scheme.

We can test all combinations of schemes in the home and siteurl options, as well as the force_ssl_admin() setting, and test the schemes of URLs returned by various functions under various situations (admin vs. front end, and is_ssl() vs. not).

Patch coming up soon.

Attachments (1)

35196.diff (6.8 KB) - added by johnbillion 10 years ago.

Download all attachments as: .zip

Change History (4)

@johnbillion
10 years ago

#1 @johnbillion
10 years ago

  • Keywords has-patch added; needs-patch removed

35196.diff is where I'm going with this. data_scheme_matrix() defines a matrix of information about which functions should return a URL with an https scheme under which circumstances. It's incomplete, and there are many failures, particularly due to the fact that wp_upload_dir() is not testable due to its use of the WP_CONTENT_URL constant.

This ticket was mentioned in Slack in #core-http by johnbillion. View the logs.


9 years ago

#5 @johnbillion
6 years ago

  • Keywords bulk-reopened added
  • Resolution set to wontfix
  • Status changed from new to closed

Closing due to lack of interest.

Note: See TracTickets for help on using tickets.