Go to file
Boone Gorges 1ee4d99972 In `wp_get_attachment_url()`, convert to HTTPS when possible.
`wp_get_attachment_url()`, via `wp_upload_dir()`, uses 'siteurl' to generate
attachment URLs. When a site is SSL-optional on the front end - ie, 'siteurl'
is non-HTTPS, but SSL is available - a number of situations can arise where
non-HTTPS attachment URLs cause browser mixed-content warnings:

a) SSL is forced in the admin and `wp_get_attachment_url()` is used to generate the `<img>` tag for an inserted image. In these cases, the post content will contain non-HTTPS. Viewing/editing this post in the Dashboard will result in non-HTTPS images being served in an SSL environment.
b) `wp_get_attachment_url()` is used in a theme to generate an `<img>` `src` attribute on a public page. When viewing that page over SSL, the images will have HTTP URLs.

This changeset switches attachment URLs to HTTPS when it's determined that the
host supports SSL. This happens when 'siteurl' is non-SSL, but the current page
request *is* over SSL, and the host of the current request matches the host of
the URL being generated.

Props joemcgill, boonebgorges.
Fixes #15928.

git-svn-id: https://develop.svn.wordpress.org/trunk@31614 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 02:38:59 +00:00
src In `wp_get_attachment_url()`, convert to HTTPS when possible. 2015-03-05 02:38:59 +00:00
tests In `wp_get_attachment_url()`, convert to HTTPS when possible. 2015-03-05 02:38:59 +00:00
tools/i18n i18n tools: Delete `data/not-gettexted-0-work.php`. 2015-02-22 12:55:34 +00:00
.editorconfig .jshintrc is a json file and .editorconfig should treat it like a json file 2014-10-08 19:26:50 +00:00
.gitignore Ignore any local WP Cli config files. 2014-10-28 17:01:22 +00:00
.jshintrc
.travis.yml Run unit tests on Travis CI with php nightlies 2015-02-26 17:49:13 +00:00
Gruntfile.js Build: Let RTLCSS handle swapping the codes for right/left arrows from Dashicons. 2015-02-27 20:18:05 +00:00
package.json RTL CSS generation: Switch from CSSJanus to RTLCSS. 2015-02-27 13:40:03 +00:00
phpunit.xml.dist Exclude external-http tests when running `phpunit`. 2014-11-10 14:48:28 +00:00
wp-cli.yml Introduce default `wp-cli.yml` for core development. 2014-04-30 21:35:18 +00:00
wp-config-sample.php Remove 'WordPress Language' reference from wp-config-sample.php. 2014-09-09 01:22:05 +00:00
wp-tests-config-sample.php