File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -813,11 +813,12 @@ function webp_uploads_enable_additional_mime_type_support_for_all_sizes( array $
813
813
* @since n.e.x.t
814
814
*
815
815
* @param array<string, mixed>|mixed $file The uploaded file data.
816
- * @return array<string, mixed>|mixed The modified file data.
816
+ * @return array<string, mixed> The modified file data.
817
817
*/
818
- function webp_uploads_convert_palette_png_to_truecolor ( $ file ) {
818
+ function webp_uploads_convert_palette_png_to_truecolor ( $ file ): array {
819
+ // Because plugins do bad things.
819
820
if ( ! is_array ( $ file ) ) {
820
- return $ file ;
821
+ $ file = array () ;
821
822
}
822
823
if ( ! isset ( $ file ['tmp_name ' ], $ file ['name ' ] ) ) {
823
824
return $ file ;
Original file line number Diff line number Diff line change @@ -1235,8 +1235,7 @@ public function data_to_test_webp_uploads_convert_palette_png_to_truecolor(): ar
1235
1235
* @covers ::webp_uploads_convert_palette_png_to_truecolor
1236
1236
*/
1237
1237
public function test_webp_uploads_convert_palette_png_to_truecolor_conditions (): void {
1238
- $ invalid_file = 'test ' ;
1239
- $ this ->assertSame ( $ invalid_file , webp_uploads_convert_palette_png_to_truecolor ( $ invalid_file ) );
1238
+ $ this ->assertSame ( array (), webp_uploads_convert_palette_png_to_truecolor ( 'test ' ) );
1240
1239
$ this ->assertSameSets ( array (), webp_uploads_convert_palette_png_to_truecolor ( array () ) );
1241
1240
1242
1241
$ file = array (
You can’t perform that action at this time.
0 commit comments