Changeset 13221
- Timestamp:
- 02/19/2010 10:59:32 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/file.php
r13025 r13221 529 529 } 530 530 531 if ( class_exists('ZipArchive') && apply_filters('unzip_file_use_ziparchive', true ) ) 532 return _unzip_file_ziparchive($file, $to, $needed_dirs); 533 else 534 return _unzip_file_pclzip($file, $to, $needed_dirs); 531 if ( class_exists('ZipArchive') && apply_filters('unzip_file_use_ziparchive', true ) ) { 532 $result = _unzip_file_ziparchive($file, $to, $needed_dirs); 533 if ( true === $result ) { 534 return $result; 535 } elseif ( is_wp_error($result) ) { 536 if ( 'incompatible_archive' != $result->get_error_code() ) 537 return $result; 538 } 539 echo "fall through to pcl"; 540 } 541 // Fall through to PclZip if ZipArchive is not available, or encountered an error opening the file. 542 return _unzip_file_pclzip($file, $to, $needed_dirs); 535 543 } 536 544 … … 591 599 return new WP_Error('copy_failed', __('Could not copy file.'), $to . $file['filename']); 592 600 } 601 602 $z->close(); 593 603 594 604 return true;
Note: See TracChangeset
for help on using the changeset viewer.