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

WordPress Trac noreply at wordpress.org
Fri Mar 11 07:23:08 UTC 2016


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

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


Comment:

 [attachment:34945.9.diff] takes the approach of combining what could be a
 couple helper functions into one that relies on context - `_wp_ssl_url(
 $url, $context = 'content' )`. Maybe that should be `is_ssl_url()` or
 `is_https_url()`? Or maybe 2 functions like azaozz suggested on the other
 ticket.

 As of this patch, we're using it in:

 * `wp_get_attachment_url()` with an admin context
 * `get_image_tag()` to reverse with a content context.
 * `attachment_submitbox_metadata()` to reverse with a content context.
 * `wp_calculate_image_srcset()` to reverse with a content context.
 * `wp_prepare_attachment_for_js()` with an admin context.

 And I got confused in here somewhere, because testing some of these
 expectations is off but I'm going to sleep. :)

 It does seem weird that we're setting one way and then reversing in a
 handful of places. Maybe this context should be added to
 `wp_get_attachment_url()` instead? Though a bunch of functions use that,
 so it may be even worse to track down.

 I think a good thing is that we're pretty sure how the `srcset` stuff can
 be fixed with a bandaid, even if we forget everything else for this cycle.
 We should keep pushing though.

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


More information about the wp-trac mailing list