Make WordPress Core

Opened 14 years ago

Closed 13 years ago

#23884 closed defect (bug) (fixed)

Avoid notices when array arguments are missing in WP_Image_Editor::multi_resize()

Reported by: dh-shredder Owned by: nacin
Priority: normal Milestone: 3.6
Component: Media Version: 3.5
Severity: normal Keywords: has-patch commit
Cc: Focuses:

Description

WP_Image_Editor::multi_resize accepts an array of arrays, where each can contain:
'height'=>int, 'width'=>int, 'crop'=>bool

At the moment, all of these are required, under penalty of notice.

In other parts of our code, 'crop' is expected to default to false and not be required.

The attached patch makes 'height' and 'width' required (skipping the resizes gracefully if they are not provided), and automatically sets crop to false if it's not provided.

Attachments (1)

23884.diff​ (3.1 KB ) - added by dh-shredder 14 years ago.
edit: comment correction

Download all attachments as: .zip

Change History (4)

#1 @markoheijnen
14 years ago

  • Milestone Awaiting Review → 3.6

@dh-shredder
14 years ago

edit: comment correction

#2 @SergeyBiryukov
14 years ago

  • Keywords commit added

#3 @nacin
13 years ago

  • Owner set to nacin
  • Resolution → fixed
  • Status new → closed

In 24055:

Image editors: multi_resize() should require height and width. Crop is now optional and defaults to false. props DH-Shredder. fixes #23884.

Note: See TracTickets for help on using tickets.