syamilmj / Aqua-Resizer

Resize WordPress images on the fly
502 stars 208 forks source link

Check for WP_Error #8

Closed bitfade closed 11 years ago

bitfade commented 11 years ago

Hey there,

first of all, great work with this script, we use it a lot and it works very well.

said so, image_resize on line 74 can also return a WP_Error object instead of a string, when the value is passed to str_replace on next line, page execution halts due the following error.

Catchable fatal error: Object of class WP_Error could not be converted to string

It happens, for instance, if user doesn't have GD extension installed. You could detect the WP_Error and just return original image url in this case. User wouldn't get a resized image but, at least, page would be displayed.

syamilmj commented 11 years ago

Thanks for the heads up, will edit the script appropriately ;)

dnstevenson commented 11 years ago

Any updates on a patch being available for this?

syamilmj commented 11 years ago

Updated to v1.1.5 which handles the issue mentioned here. Cheers