WordPress.org

Make WordPress Core

Ticket #12637: 12637.noticefix.diff

File 12637.noticefix.diff, 708 bytes (added by sivel, 4 years ago)

Check if ZIP_ER_OK is defined before testing it

  • wp-admin/includes/file.php

     
    577577 
    578578        // PHP4-compat - php4 classes can't contain constants 
    579579        $zopen = $z->open($file, /* ZIPARCHIVE::CHECKCONS */ 4); 
    580         if ( true !== $zopen || ZIP_ER_OK !== $zopen ) // may return true, or (int)0 ZIP_ER_OK under certain versions 
     580        if ( true !== $zopen || ( defined('ZIP_ER_OK') && ZIP_ER_OK !== $zopen ) ) // may return true, or (int)0 ZIP_ER_OK under certain versions 
    581581                return new WP_Error('incompatible_archive', __('Incompatible Archive.')); 
    582582 
    583583        for ( $i = 0; $i < $z->numFiles; $i++ ) {