Ticket #22308: 22308.version-check.diff
| File 22308.version-check.diff, 1.3 KB (added by DH-Shredder, 7 months ago) |
|---|
-
wp-includes/class-wp-image-editor-imagick.php
29 29 /** 30 30 * Checks to see if current environment supports Imagick. 31 31 * 32 * We require Imagick 2. 1.1or greater, based on whether the queryFormats()32 * We require Imagick 2.2.0 or greater, based on whether the queryFormats() 33 33 * method can be called statically. 34 34 * 35 35 * @since 3.5.0 … … 40 40 public static function test( $args = array() ) { 41 41 42 42 // First, test Imagick's extension and classes. 43 if ( ! extension_loaded( 'imagick' ) || ! class_exists( 'Imagick' ) || ! class_exists( 'ImagickPixel' ) ) 43 if ( ! extension_loaded( 'imagick' ) || 44 ! version_compare( phpversion( 'imagick' ), '2.1.1', '>') || 45 ! class_exists( 'Imagick' ) || 46 ! class_exists( 'ImagickPixel' ) ) { 47 44 48 return false; 49 } 45 50 46 51 $required_methods = array( 47 52 'clear', … … 64 69 ); 65 70 66 71 // Now, test for deep requirements within Imagick. 67 if ( ! is_callable( 'Imagick', 'queryFormats' ) || 68 ! defined( 'imagick::COMPRESSION_JPEG' ) || 72 if ( ! defined( 'imagick::COMPRESSION_JPEG' ) || 69 73 array_diff( $required_methods, get_class_methods( 'Imagick' ) ) ) { 70 74 71 75 return false;