From 4dcca90887fe0639fecdaa2ec6fa4b24b0886865 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Mon, 14 Oct 2013 21:55:09 +0000 Subject: [PATCH] Remove PHP4 compat code from the ZipArchive unzip handler, and pass the failure reason into the WP_Error return. See #22704 Built from https://develop.svn.wordpress.org/trunk@25779 git-svn-id: http://core.svn.wordpress.org/trunk@25692 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/file.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index 8607b98ce7..323789029b 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -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;