Make WordPress Core

Ticket #58309: 58309.2.diff

File 58309.2.diff, 2.0 KB (added by costdev, 3 years ago)

Reverse conditions in is_gd_image() too.

  • src/wp-admin/includes/class-pclzip.php

    diff --git a/src/wp-admin/includes/class-pclzip.php b/src/wp-admin/includes/class-pclzip.php
    index b1b39e2dfe..3f26dee2e4 100644
    a b  
    11701170    // ----- Reset the error handler
    11711171    $this->privErrorReset();
    11721172
    1173     // ----- Look if the $p_archive is a PclZip object
    1174     if (is_object($p_archive) && $p_archive instanceof pclzip)
     1173    // ----- Look if the $p_archive is an instantiated PclZip object
     1174    if ($p_archive instanceof pclzip)
    11751175    {
    11761176
    11771177      // ----- Duplicate the archive
     
    12341234      return(0);
    12351235    }
    12361236
    1237     // ----- Look if the $p_archive_to_add is a PclZip object
    1238     if (is_object($p_archive_to_add) && $p_archive_to_add instanceof pclzip)
     1237    // ----- Look if the $p_archive_to_add is an instantiated PclZip object
     1238    if ($p_archive_to_add instanceof pclzip)
    12391239    {
    12401240
    12411241      // ----- Merge the archive
  • src/wp-includes/media.php

    diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php
    index 281e896fa0..0d22ada14e 100644
    a b function get_taxonomies_for_attachments( $output = 'names' ) { 
    37483748 * Determines whether the value is an acceptable type for GD image functions.
    37493749 *
    37503750 * In PHP 8.0, the GD extension uses GdImage objects for its data structures.
    3751  * This function checks if the passed value is either a resource of type `gd`
    3752  * or a GdImage object instance. Any other type will return false.
     3751 * This function checks if the passed value is either a GdImage object instance
     3752 * or a resource of type `gd`. Any other type will return false.
    37533753 *
    37543754 * @since 5.6.0
    37553755 *
    function get_taxonomies_for_attachments( $output = 'names' ) { 
    37583758 *              false otherwise.
    37593759 */
    37603760function is_gd_image( $image ) {
    3761         if ( is_resource( $image ) && 'gd' === get_resource_type( $image )
    3762                 || is_object( $image ) && $image instanceof GdImage
     3761        if ( $image instanceof GdImage
     3762                || is_resource( $image ) && 'gd' === get_resource_type( $image )
    37633763        ) {
    37643764                return true;
    37653765        }