Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#23325 closed defect (bug) (fixed)

wp_crop_image does not return WP_Error when save fails

Reported by: macbrink Owned by: SergeyBiryukov
Priority: normal Milestone: 3.6
Component: Media Version: 3.5
Severity: normal Keywords: has-patch commit needs-codex
Cc: Focuses:

Description

wp_crop_image() assigns

$result = $editor->save( $dst_file );

but never actually tests/returns if $result is WP_Error

Attachments (1)

image.php.patch (918 bytes ) - added by macbrink 14 years ago.
patch for image.php including phpDocs

Download all attachments as: .zip

Change History (6)

#1 @markoheijnen
14 years ago

  • Milestone Awaiting Review3.6
  • Version 3.5.13.5

That is indeed stupid. Also you should change the PHPDocs. Normally it returned false but thats not anymore the case.

@macbrink
14 years ago

patch for image.php including phpDocs

#2 @markoheijnen
14 years ago

  • Keywords commit added

#3 @SergeyBiryukov
14 years ago

In 1201/tests:

wp_crop_image() test for error on saving. see #23325.

#4 @SergeyBiryukov
14 years ago

  • Owner set to SergeyBiryukov
  • Resolutionfixed
  • Status newclosed

In 23374:

Return WP_Error from wp_crop_image() if saving has failed. props macbrink. fixes #23325.

#5 @DrewAPicture
13 years ago

  • Keywords needs-codex added

WP_Error on failure in wp_crop_image()

Note: See TracTickets for help on using tickets.