[wp-trac] [WordPress Trac] #34945: HTTPS website with HTTP images

WordPress Trac noreply at wordpress.org
Wed Mar 9 22:36:58 UTC 2016


#34945: HTTPS website with HTTP images
--------------------------------------------+--------------------------
 Reporter:  Angristan                       |       Owner:  johnbillion
     Type:  defect (bug)                    |      Status:  reopened
 Priority:  normal                          |   Milestone:  4.5
Component:  Media                           |     Version:  4.4
 Severity:  normal                          |  Resolution:
 Keywords:  https has-patch has-unit-tests  |     Focuses:
--------------------------------------------+--------------------------

Comment (by joemcgill):

 [attachment:34945.3.diff] moves the fix from [attachment:34945.2.diff]
 into `wp_calculate_image_srcset()` now that `_wp_upload_dir_baseurl()` has
 been deprecated.

 This will force the scheme of images inside `srcset` attributes to HTTPS
 any time the site is being viewed over HTTPS and we know the hostname for
 the image matches the hostname of the page generating the requests. In
 other words, we only switch schemes when we know the uploads directory is
 available over HTTPS because it matches the current page, which is being
 viewed over HTTPS.

 If in the future, we make `wp_upload_dir()` scheme aware, we can remove
 this check since it will be redundant (See #34109). Until that time, this
 targeted fix should clear up most of the HTTPS image issues we have since
 adding `srcset` in WP 4.4.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34945#comment:43>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list