2024-03-05 10:31:15
最后更新时间:2021-12-30 15:08:33
编辑wp-admin/includes/file.php
这个文件
$new_file = $uploads['path'] . "/$filename";
替换为:
$new_file = $uploads['path'] . "/" . iconv("UTF-8","GB2312",$filename);
注意,之需要替换第一处即可!
return apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ), 'upload' );
修改为:(修正中文文件名编码问题)
return apply_filters( 'wp_handle_upload', array( 'file' => $uploads['path'] . "/$filename", 'url' => $url, 'type' => $type ) , 'upload');
如果有不明白的地方,欢迎在后台提交工单。