Created
October 2, 2012 23:21
-
-
Save imjjss/3823932 to your computer and use it in GitHub Desktop.
upload file with chinese name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
要修改的是wordpress\wp-admin\includes\file.php | |
查找: | |
$filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback ); | |
在其后加上: | |
$fileTypeNameArr =explode("." , $filename); | |
$countNum=count($fileTypeNameArr)-1; | |
$fileExt = $fileTypeNameArr[$countNum]; //取得所上传文件后缀名 | |
$filename = time().'-'.rand(0,999999999).'.'.$fileExt;//将文件由原名改为时间戳 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this one doesn't work anymore