Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#10613 closed defect (bug) (fixed)

Fatal Error if EXIF extension not loaded

Reported by: hakre's profile hakre Owned by:
Milestone: 2.9 Priority: normal
Severity: normal Version: 2.9
Component: General Keywords: has-patch tested
Focuses: Cc:

Description

if the php exif extension is not loaded, uploading an image throws a fatal error in /wp-includes/media.php on line 388

Call Stack
#	Time	Memory	Function	Location
1	0.0006	83408	{main}( )	..(null):0
2	1.0135	22507080	media_handle_upload( string(12), string(3), ??? )	..(null):43
3	1.0366	22546024	wp_generate_attachment_metadata( long, string(66) )	..(null):232
4	1.0411	22547544	image_make_intermediate_size( string(66), string(3), string(3), string(1) )	..(null):112
5	1.0411	22547864	image_resize( string(66), string(3), string(3), string(1), ???, ???, ??? )	..(null):437

this is current trunk. normally, this library is available, but some setups need you to manually enable it. since the component is used, it should be added to the checks wether or not the system has all components for wordpress.

compared to other cases ( #6571 ) that time the error message was only suppressed. IMHO it's a pitty if you get no hint that you should enable that library to get more functionally. If the error message is suppressed, you get no such hint.

Attachments (1)

10613.diff (633 bytes) - added by dd32 15 years ago.

Download all attachments as: .zip

Change History (7)

#1 @dd32
15 years ago

What is the exact error?

That previous ticket warning was not related to the exif library not being available, rather a different error case (And it was in a conditional to check if it was loaded anyway)

#2 @dd32
15 years ago

However, Looking at the code, You're right.. Its not checked for in that branch of code.. I'll make a patch up

@dd32
15 years ago

#3 @dd32
15 years ago

  • Keywords has-patch added; needs-patch removed

#4 @hakre
15 years ago

  • Keywords tested added

Tested the patch:

  • Updated to latest trunk & applied the patch.
  • Disabled EXIF in the PHP config.
  • Uploaded an image, no fatal error was thrown.
  • Reverted the patch.
  • Uploaded an image, a fatal error was thrown.

So overall testing was a SUCCESS. Good to go from my side.

#5 @azaozz
15 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [11825]) Check if EXIF extension is loaded, props dd32, fixes #10613

#6 @azaozz
15 years ago

This will likely be reworked when image crop and rotate functionality is added to core.

Note: See TracTickets for help on using tickets.