Properly return new WP_Error objects. props bpetty. see #6812.

git-svn-id: http://core.svn.wordpress.org/trunk@22420 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2012-11-07 17:49:00 +00:00
parent 0794b91606
commit 03794fddb3
1 changed files with 4 additions and 4 deletions

View File

@ -146,7 +146,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
return $resized;
}
return WP_Error( 'image_resize_error', __('Image resize failed.'), $this->file );
return new WP_Error( 'image_resize_error', __('Image resize failed.'), $this->file );
}
/**
@ -222,7 +222,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
return true;
}
return WP_Error( 'image_crop_error', __('Image crop failed.'), $this->file );
return new WP_Error( 'image_crop_error', __('Image crop failed.'), $this->file );
}
/**
@ -246,7 +246,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
return true;
}
}
return WP_Error( 'image_rotate_error', __('Image rotate failed.'), $this->file );
return new WP_Error( 'image_rotate_error', __('Image rotate failed.'), $this->file );
}
/**
@ -273,7 +273,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
return true;
}
}
return WP_Error( 'image_flip_error', __('Image flip failed.'), $this->file );
return new WP_Error( 'image_flip_error', __('Image flip failed.'), $this->file );
}
/**