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

WordPress Trac noreply at wordpress.org
Wed Nov 25 12:40:50 UTC 2020


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

Comment (by luigipulcini):

 I think the best way to approach this issue would be changing this line of
 the `_wp_upload_dir` function:

 {{{$siteurl = get_option( 'siteurl' );}}}

 into this:

 {{{$siteurl = get_site_url();}}}

 `get_site_url` starts from the same value but also makes sure the correct
 scheme is returned by using the `set_url_scheme` function while
 `get_option( 'siteurl' )` simply returns the bare value stored in the
 database.

 [https://github.com/WordPress/WordPress/blob/e89f6692745937af4bfe5acbf8c5918f393bbc77
 /wp-includes/functions.php#L2355]

 I hope this helps.
 Luigi.

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


More information about the wp-trac mailing list