From 47c25b41af721fee8348714e93ac5bc6d3140da9 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Wed, 11 Sep 2013 08:08:35 +0000 Subject: [PATCH] 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 --- src/wp-admin/includes/file.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php index 36977a05a7..484a191022 100644 --- a/src/wp-admin/includes/file.php +++ b/src/wp-admin/includes/file.php @@ -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) )