diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index d031656d43..4171a570e0 100644
a
|
b
|
function sanitize_file_name( $filename ) { |
2006 | 2006 | $filename = preg_replace( "#\x{00a0}#siu", ' ', $filename ); |
2007 | 2007 | } |
2008 | 2008 | |
| 2009 | $filename = str_replace( array( '%20', '+' ), '-', $filename ); |
| 2010 | |
2009 | 2011 | /** |
2010 | 2012 | * Filters the list of characters to remove from a filename. |
2011 | 2013 | * |
… |
… |
function sanitize_file_name( $filename ) { |
2017 | 2019 | $special_chars = apply_filters( 'sanitize_file_name_chars', $special_chars, $filename_raw ); |
2018 | 2020 | |
2019 | 2021 | $filename = str_replace( $special_chars, '', $filename ); |
2020 | | $filename = str_replace( array( '%20', '+' ), '-', $filename ); |
2021 | 2022 | $filename = preg_replace( '/[\r\n\t -]+/', '-', $filename ); |
2022 | 2023 | $filename = trim( $filename, '.-_' ); |
2023 | 2024 | |