[wp-trac] [WordPress Trac] #24117: Multisite installations using ms-files.php rewriting can't handle uploaded files with plus sign (+) in the file name

WordPress Trac noreply at wordpress.org
Thu Apr 18 05:57:56 UTC 2013


#24117: Multisite installations using ms-files.php rewriting can't handle uploaded
files with plus sign (+) in the file name
-----------------------------+--------------------------
 Reporter:  jamescollins     |       Type:  defect (bug)
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  Multisite
  Version:  3.0              |   Severity:  normal
 Keywords:                   |
-----------------------------+--------------------------
 On a WordPress Multisite network that uses ms-files.php rewriting, if you
 upload a file with a plus sign in the file name then the file isn't
 accessible via the default {{{/files/}}} URL.

 Steps to reproduce:
 On a Multisite installation that was set up prior to WP 3.5), upload a
 file with a plus sign in the file name (eg {{{file name here+.pdf}}}),
 WordPress renames the file to {{{file-name-here+.pdf}}}.

 The file's URL is then:

 http://domain.com/files/file-name-here+.pdf

 However loading that URL results in a 404 error.

 However manually requesting the file via the non-pretty URL (ie not going
 via ms-files.php) does work:

 http://domain.com/wp-content/blogs/dir/1/file-name-here+.pdf


 ms-files.php attempts to locate this file:

 {{{/path/to/wordpress/wp-content/blogs.dir/1/files/file-name-here .pdf}}}
 which doesn't exist, because the file on the filesystem still has the plus
 sign in the name ({{{/path/to/wordpress/wp-content/blogs.dir/1/files/file-
 name-here+.pdf}}}.


 I think WordPress' {{{sanitize_file_name()}}} function should
 automatically remove the {{{+}}} character from file names during the
 upload process.

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


More information about the wp-trac mailing list