mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
Check for "ZIP_ER_OK" return value on ZipArchive. See #12637
git-svn-id: http://svn.automattic.com/wordpress/trunk@14346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7843826140
commit
3213eab0f8
@ -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++ ) {
|
||||
|
Loading…
Reference in New Issue
Block a user