mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Check for [\r\n\t ] instead of \s in sanitize_file_name() to avoid UTF-8 issues.
props p_enrique. fixes #26094. git-svn-id: https://develop.svn.wordpress.org/trunk@29715 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f114ff72ac
commit
ad0b20ad09
@ -1054,10 +1054,10 @@ function sanitize_file_name( $filename ) {
|
||||
*/
|
||||
$special_chars = apply_filters( 'sanitize_file_name_chars', $special_chars, $filename_raw );
|
||||
$filename = preg_replace( "#\x{00a0}#siu", ' ', $filename );
|
||||
$filename = str_replace($special_chars, '', $filename);
|
||||
$filename = str_replace( $special_chars, '', $filename );
|
||||
$filename = str_replace( array( '%20', '+' ), '-', $filename );
|
||||
$filename = preg_replace('/[\s-]+/', '-', $filename);
|
||||
$filename = trim($filename, '.-_');
|
||||
$filename = preg_replace( '/[\r\n\t -]+/', '-', $filename );
|
||||
$filename = trim( $filename, '.-_' );
|
||||
|
||||
// Split the filename into a base and extension[s]
|
||||
$parts = explode('.', $filename);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user