mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 21:00:21 +00:00
Fotmatting: in sanitize_file_name(), escape % when uploads contain them, otherwise attachment URLs will unescape the char and break.
Adds unit tests. Props mordauk, simonwheatley, dd32, solarissmoke. Fixes #16226. git-svn-id: https://develop.svn.wordpress.org/trunk@35122 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1368,7 +1368,7 @@ function remove_accents( $string ) {
|
||||
*/
|
||||
function sanitize_file_name( $filename ) {
|
||||
$filename_raw = $filename;
|
||||
$special_chars = array("?", "[", "]", "/", "\\", "=", "<", ">", ":", ";", ",", "'", "\"", "&", "$", "#", "*", "(", ")", "|", "~", "`", "!", "{", "}", chr(0));
|
||||
$special_chars = array("?", "[", "]", "/", "\\", "=", "<", ">", ":", ";", ",", "'", "\"", "&", "$", "#", "*", "(", ")", "|", "~", "`", "!", "{", "}", "%", "+", chr(0));
|
||||
/**
|
||||
* Filter the list of characters to remove from a filename.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user