From 5128c1ccc24fae12950ec537d886684f367bcd50 Mon Sep 17 00:00:00 2001 From: westi Date: Sun, 7 Feb 2010 21:28:05 +0000 Subject: [PATCH] Make _unzip_file_ziparchive() PHP4 safe. See #10403. git-svn-id: http://svn.automattic.com/wordpress/trunk@13015 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/file.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index b2721628e3..b37f6fdb42 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -547,11 +547,13 @@ function unzip_file($file, $to) { * @param array $needed_dirs A partial list of required folders needed to be created. * @return mixed WP_Error on failure, True on success */ -function _unzip_file_ziparchive($file, $to, $needed_dirs = array()) { +function _unzip_file_ziparchive($file, $to, $needed_dirs = array() ) { global $wp_filesystem; $z = new ZipArchive(); - if ( true !== $z->open($file, ZIPARCHIVE::CHECKCONS) ) + + // PHP4-compat - php4 classes can't contain constants + if ( true !== $z->open($file, /* ZIPARCHIVE::CHECKCONS */ 4) ) return new WP_Error('incompatible_archive', __('Incompatible Archive.')); for ( $i = 0; $i < $z->numFiles; $i++ ) {