[wp-trac] [WordPress Trac] #15928: wp_get_attachment_url does not check for HTTPS
WordPress Trac
noreply at wordpress.org
Wed Nov 5 13:30:46 UTC 2014
#15928: wp_get_attachment_url does not check for HTTPS
-------------------------------------+---------------------------
Reporter: atetlaw | Owner: boonebgorges
Type: defect (bug) | Status: accepted
Priority: normal | Milestone: 4.1
Component: Permalinks | Version: 3.0.3
Severity: normal | Resolution:
Keywords: needs-testing has-patch | Focuses:
-------------------------------------+---------------------------
Comment (by joemcgill):
After spending some time with
[https://core.trac.wordpress.org/attachment/ticket/15928/15928.6.patch
15928.6.patch], I'd like to suggest we simplify this a bit more for the
time being. As Boone articulated, there are really two main concerns that
are trying to be addressed by this ticket.
The first, is that `wp_get_attachment_url()` should return an https://
scheme when running in SSL and http:// when not. I've attached a new diff
which addresses this distinct case and provides unit tests, nothing more.
The second, more complicated concern is that once an image is embedded in
a post, it will always be displayed on the front end using the scheme that
was in play when the post was authored because, at that point, the url is
a part of the post content in the database. We may be able to be smarter
about how those URLs are generated based on the SSL settings of the site
itself, but that still wouldn't change image urls in any posts that were
authored before that fix is in place.
[https://core.trac.wordpress.org/attachment/ticket/15928/15928.6.patch
15928.6.patch] is a first stab at solving the second case by introducing
network_path urls, but the updated method in `media.view.EmbedImage`
doesn't ever seem to actually fire (but I may just be missing something).
Additionally, there seems to have been some strong aversion to introducing
network_path urls into the system, so I think that part may need more
review.
For these reasons, I'm suggesting we resolve the first case and readdress
the second in as a separate ticket.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/15928#comment:77>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list