Switch unzip_file() over to using the mbstring.func_override helper functions. See #25259
git-svn-id: https://develop.svn.wordpress.org/trunk@25347 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
052d276215
commit
47c25b41af
@ -642,11 +642,7 @@ function _unzip_file_ziparchive($file, $to, $needed_dirs = array() ) {
|
||||
function _unzip_file_pclzip($file, $to, $needed_dirs = array()) {
|
||||
global $wp_filesystem;
|
||||
|
||||
// See #15789 - PclZip uses string functions on binary data, If it's overloaded with Multibyte safe functions the results are incorrect.
|
||||
if ( ( ini_get('mbstring.func_overload') & 2 ) && function_exists('mb_internal_encoding') ) {
|
||||
$previous_encoding = mb_internal_encoding();
|
||||
mb_internal_encoding('ISO-8859-1');
|
||||
}
|
||||
mbstring_binary_safe_encoding();
|
||||
|
||||
require_once(ABSPATH . 'wp-admin/includes/class-pclzip.php');
|
||||
|
||||
@ -654,8 +650,7 @@ function _unzip_file_pclzip($file, $to, $needed_dirs = array()) {
|
||||
|
||||
$archive_files = $archive->extract(PCLZIP_OPT_EXTRACT_AS_STRING);
|
||||
|
||||
if ( isset($previous_encoding) )
|
||||
mb_internal_encoding($previous_encoding);
|
||||
reset_mbstring_encoding();
|
||||
|
||||
// Is the archive valid?
|
||||
if ( !is_array($archive_files) )
|
||||
|
Loading…
Reference in New Issue
Block a user