Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#23325 closed defect (bug) (fixed)

wp_crop_image does not return WP_Error when save fails

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


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 8 years ago.
patch for image.php including phpDocs

Download all attachments as: .zip

Change History (6)

#1 @markoheijnen
8 years ago

  • Milestone changed from Awaiting Review to 3.6
  • Version changed from 3.5.1 to 3.5

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

8 years ago

patch for image.php including phpDocs

#2 @markoheijnen
8 years ago

  • Keywords commit added

#3 @SergeyBiryukov
8 years ago

In 1201/tests:

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

#4 @SergeyBiryukov
8 years ago

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

In 23374:

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

#5 @DrewAPicture
8 years ago

  • Keywords needs-codex added

WP_Error on failure in wp_crop_image()

Note: See TracTickets for help on using tickets.