Make WordPress Core


Ignore:
Timestamp:
08/16/2020 01:31:57 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Code Modernization: Introduce is_gd_image() to check for PHP 8 GdImage object instances.

In PHP 8, the GD extension uses GdImage objects instead of resources for its underlying data structures.

This updates the existing is_resource() calls for image resources in core to accomodate for GdImage instances as well.

Props ayeshrajans, jrf.
Fixes #50833.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-image-editor-imagick.php

    r48586 r48798  
    549549            return new WP_Error( 'image_crop_error', $e->getMessage() );
    550550        }
     551
    551552        return $this->update_size();
    552553    }
     
    583584            return new WP_Error( 'image_rotate_error', $e->getMessage() );
    584585        }
     586
    585587        return true;
    586588    }
Note: See TracChangeset for help on using the changeset viewer.