Remove PHP4 compat code from the ZipArchive unzip handler, and pass the failure reason into the WP_Error return.

See #22704


git-svn-id: https://develop.svn.wordpress.org/trunk@25779 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2013-10-14 21:54:33 +00:00
parent 67c80dae13
commit b492ae85f8
1 changed files with 2 additions and 3 deletions

View File

@ -596,10 +596,9 @@ function _unzip_file_ziparchive($file, $to, $needed_dirs = array() ) {
$z = new ZipArchive();
// PHP4-compat - php4 classes can't contain constants
$zopen = $z->open($file, /* ZIPARCHIVE::CHECKCONS */ 4);
$zopen = $z->open( $file, ZIPARCHIVE::CHECKCONS );
if ( true !== $zopen )
return new WP_Error('incompatible_archive', __('Incompatible Archive.'));
return new WP_Error( 'incompatible_archive', __( 'Incompatible Archive.' ), array( 'ziparchive_error' => $zopen ) );
$uncompressed_size = 0;