[wp-trac] [WordPress Trac] #25449: wp_upload_dir() doesn't support https

WordPress Trac noreply at wordpress.org
Tue Mar 8 23:44:36 UTC 2016


#25449: wp_upload_dir() doesn't support https
-------------------------------------------+-----------------------------
 Reporter:  ryanhellyer                    |       Owner:
     Type:  defect (bug)                   |      Status:  new
 Priority:  normal                         |   Milestone:  Future Release
Component:  Upload                         |     Version:  3.8
 Severity:  major                          |  Resolution:
 Keywords:  needs-testing https has-patch  |     Focuses:
-------------------------------------------+-----------------------------

Comment (by thomaswm):

 Replying to [comment:33 joemcgill]:
 > 1. If we go this route, the scheme checks should probably be moved to
 `_wp_upload_dir()` and be applied to the `$baseurl` variable so that the
 scheme is set before the `upload_dir` filter is applied. As is, it looks
 like your patch would fail since the `$uploads` variable isn't set until
 after your code.

 You're right. I've uploaded a corrected version of the patch:
 [attachment:25449.3.diff].

 > 2. In `get_image_tag()` we should check for the scheme of the
 `upload_url_path` option, the `WP_CONTENT_URL` constant, and then the
 `siteurl` option instead of the `home` option, since those are what is
 being used by `wp_upload_dir()` when building URLs now.

 As WordPress defines the `WP_CONTENT_URL` constant as
 {{{
 define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
 }}}
 if the user hasn't defined it, I think it's sufficient to check
 `upload_url_path` and `WP_CONTENT_URL` and omit the `siteurl` option.

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


More information about the wp-trac mailing list