mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
PDF Images: Avoid a PHP Warning when attempting to process a file without an extension.
Props chandrapatel for initial patch. Fixes #39195. git-svn-id: https://develop.svn.wordpress.org/trunk@39580 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 524 B |
@@ -542,4 +542,15 @@ class Tests_Image_Editor_GD extends WP_Image_UnitTestCase {
|
||||
unlink( $save_to_file );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test WP_Image_Editor_GD handles extension-less images
|
||||
* @ticket 39195
|
||||
*/
|
||||
public function test_image_non_existent_extension() {
|
||||
$image_editor = new WP_Image_Editor_GD( DIR_TESTDATA.'/images/test-image-no-extension' );
|
||||
$result = $image_editor->load();
|
||||
|
||||
$this->assertTrue( $result );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -531,4 +531,15 @@ class Tests_Image_Editor_Imagick extends WP_Image_UnitTestCase {
|
||||
$this->assertImageAlphaAtPointImagick( $save_to_file, array( 0, 0 ), $pre_rotate_alpha );
|
||||
unlink( $save_to_file );
|
||||
}
|
||||
|
||||
/**
|
||||
* Test WP_Image_Editor_Imagick handles extension-less images
|
||||
* @ticket 39195
|
||||
*/
|
||||
public function test_image_non_existent_extension() {
|
||||
$image_editor = new WP_Image_Editor_Imagick( DIR_TESTDATA.'/images/test-image-no-extension' );
|
||||
$result = $image_editor->load();
|
||||
|
||||
$this->assertTrue( $result );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user