From 6b49c70b097c0acb5a7c3f4f515d9ea487156a09 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Sun, 2 May 2010 22:25:30 +0000 Subject: [PATCH] Check for "ZIP_ER_OK" return value on ZipArchive. See #12637 git-svn-id: https://develop.svn.wordpress.org/trunk@14346 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/file.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index d8d9d59aae..cd015d91a7 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -576,7 +576,8 @@ function _unzip_file_ziparchive($file, $to, $needed_dirs = array() ) { $z = new ZipArchive(); // PHP4-compat - php4 classes can't contain constants - if ( true !== $z->open($file, /* ZIPARCHIVE::CHECKCONS */ 4) ) + $zopen = $z->open($file, /* ZIPARCHIVE::CHECKCONS */ 4); + if ( true !== $zopen || ZIP_ER_OK !== $zopen ) // may return true, or (int)0 ZIP_ER_OK under certain versions return new WP_Error('incompatible_archive', __('Incompatible Archive.')); for ( $i = 0; $i < $z->numFiles; $i++ ) {