[wp-trac] [WordPress Trac] #34109: Incorrect URL scheme for media in the admin area when using administration over HTTPS

WordPress Trac noreply at wordpress.org
Fri Dec 11 04:34:28 UTC 2015


#34109: Incorrect URL scheme for media in the admin area when using administration
over HTTPS
-----------------------------+-----------------------------
 Reporter:  johnbillion      |       Owner:
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Future Release
Component:  Media            |     Version:
 Severity:  major            |  Resolution:
 Keywords:  https has-patch  |     Focuses:  administration
-----------------------------+-----------------------------
Changes (by joemcgill):

 * keywords:  needs-patch needs-unit-tests https => https has-patch


Comment:

 I can confirm that `srcset` attributes will be added to the thumbnails in
 the media library list view, but only if there are other square versions
 of the image available. This will happen if the original full-size image
 is square, or if there was a custom square crop defined when the image was
 originally uploaded.

 The two use cases from #15928 where this sort of thing came up was when
 either, a) the site was serving the admin from a separate SSL enabled
 domain than the front end or b) the site was using a self-signed
 certificate in the back end with an HTTP front end.

 In the backend, we can filter the scheme of
 `wp_get_attachment_image_src()` when `force_ssl_admin()` returns true,
 which is the lowest level function used to build these URLs that doesn't
 affect the images inserted into the editor, which uses `get_image_tag()`.
 Both functions rely on `image_downsize()`, so we can't filter that far
 down the chain.

 [https://core.trac.wordpress.org/attachment/ticket/34109/34109.diff
 34109.diff] Adds a test for this bug and includes a patch to
 `wp_get_attachment_image_src()` that addresses this issue. There may be
 other cases where we might want to switch to HTTPS schemes in
 `wp_get_attachment_image_src()`, but this is a start.

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


More information about the wp-trac mailing list