[wp-trac] [WordPress Trac] #23755: Old /files/ support in new installs

WordPress Trac noreply at wordpress.org
Wed Mar 13 13:54:11 UTC 2013


#23755: Old /files/ support in new installs
-----------------------------+--------------------------
 Reporter:  unsalkorkmaz     |       Type:  defect (bug)
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  Filesystem
  Version:                   |   Severity:  minor
 Keywords:                   |
-----------------------------+--------------------------
 I moved a blog to a new network that using new upload folder system.
 Problem is: old /files/ links  that using ms-files.php are not working.

 My temporary fix:
 Added in .htaccess:

 {{{
 # uploaded files
 RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

 }}}

 Added ms-files.php:
 {{{
 define( 'BLOGUPLOADDIR', WP_CONTENT_DIR .
 "/uploads/sites/{$current_blog->blog_id}/" );

 }}}
 above of:

 {{{
 $file = rtrim( BLOGUPLOADDIR, '/' ) . '/' . str_replace( '..', '', $_GET[
 'file' ] );
 }}}

 Solution is working but I am not happy because it needs to edit core
 files. Is this working as intended? If it is, what is proper way to define
 BLOGUPLOADDIR for ms-files.php without breaking anything or editing ms-
 files.php

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23755>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list