Browse files

Strip nulls

git-svn-id: http://svn.automattic.com/wordpress/branches/2.8@12073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
1 parent 15d5dbd commit bf7442a9a3e5bdbcdadcf2ce3a8ab8e7c113682f ryan committed Oct 20, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 wp-includes/formatting.php
View
2 wp-includes/formatting.php
@@ -600,7 +600,7 @@ function remove_accents($string) {
*/
function sanitize_file_name( $filename ) {
$filename_raw = $filename;
- $special_chars = array("?", "[", "]", "/", "\\", "=", "<", ">", ":", ";", ",", "'", "\"", "&", "$", "#", "*", "(", ")", "|", "~", "`", "!", "{", "}");
+ $special_chars = array("?", "[", "]", "/", "\\", "=", "<", ">", ":", ";", ",", "'", "\"", "&", "$", "#", "*", "(", ")", "|", "~", "`", "!", "{", "}", chr(0));
$special_chars = apply_filters('sanitize_file_name_chars', $special_chars, $filename_raw);
$filename = str_replace($special_chars, '', $filename);
$filename = preg_replace('/[\s-]+/', '-', $filename);

0 comments on commit bf7442a

Please sign in to comment.