Make WordPress Core

Opened 7 years ago

Last modified 2 years ago

#23483 new defect (bug)

Incorrect image URL for subsites when using UPLOADS constant on multisite subdirectory installation — at Initial Version

Reported by: creativeinfusion Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.5.1
Component: Upload Keywords: needs-patch
Focuses: multisite Cc:


If the UPLOADS constant is used on a Wordpress Multisite installed to subdirectory, using subdirectory mode, then image URLs for subsites are incorrect.

WP MS installed to www.domain.com/wordpress, subdirectory not subdomain
UPLOADS set to 'assets'

Main site uploads images to /wordpress/assets/...
Main site image URL is www.domain.com/wordpress/assets/...

Create subsite called 'subsite';
Subsite uploads images to /wordpress/assets/sites/2/...
Subsite image URL is www.domain.com/uk/assets/sites/2/... when it should be www.domain.com/assets/sites/2/...

This is because wp_upload_dir() uses get_option('siteurl') to derive the URL. It is probably right for subdomain multisite but wrong in this use case.

Change History (0)

Note: See TracTickets for help on using tickets.