Opened 2 months ago

Last modified 2 months ago

#23750 new defect (bug)

Uploads go into subdirectory install of WordPress

Reported by: jondavidjohn Owned by:
Priority: normal Milestone: Awaiting Review
Component: Multisite Version: 3.5.1
Severity: normal Keywords: needs-patch
Cc: matt@…

Description

In upgrading a few sites to WordPress 3.5 and then giving WordPress its own directory (wp/), we continually see the uploads end up in wp/wp-content/blogs.dir instead of wp-content/blogs.dir.

For the time being as a work around we have enabled a network wide plugin that consists of

function ms_upload_fix($uploads) {
	$uploads['path'] = str_replace('/wp/', '/', $uploads['path']);
	$uploads['basedir'] = str_replace('/wp/', '/', $uploads['basedir']);
	return $uploads;
}
add_filter('upload_dir', 'ms_upload_fix');

We do have WP_CONTENT_DIR defined and assume it should use this if set.

Change History (3)

  • Cc matt@… added
  • Component changed from Upload to Multisite

There may very well be a bug here to fix, and I'd like to. That said:

  • blogs.dir is only supported for networks installed prior to 3.5.
  • Installing WordPress in a subdirectory is only supported for networks installed in 3.5 or later.

Shifting an older install to a subdirectory was never tested, at least not with blogs.dir, which would probably explain why this was missed.

Note: See TracTickets for help on using tickets.