WordPress.org

Make WordPress Core

Opened 7 months ago

Closed 6 months ago

#45420 closed defect (bug) (fixed)

requiring wp-admin/includes/image.php twice in WP_REST_Attachments_Controller::create_item

Reported by: david.binda Owned by: pento
Milestone: 5.0.2 Priority: normal
Severity: minor Version: 5.0
Component: REST API Keywords: has-patch fixed-5.0
Focuses: Cc:

Description

The r43773 introduced require_once ABSPATH . 'wp-admin/includes/image.php' twice in WP_REST_Attachments_Controller::create_item method.

While the require_once mitigates the possible side-effect of redeclaring the same functions twice on the media endpoint, it should be really only required once, since it's enough :)

Attachments (1)

45420.diff (652 bytes) - added by david.binda 7 months ago.

Download all attachments as: .zip

Change History (9)

@david.binda
7 months ago

#1 @desrosj
7 months ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 5.0.1
  • Severity changed from normal to minor

Thanks, @david.binda. Your patch looks good to me.

Marking this as a 5.0.1 item, but it's relatively minor and can be punted if need be (mainly depending on how quickly 5.0.1 is released).

#2 @desrosj
7 months ago

  • Keywords commit added

#3 @pento
6 months ago

  • Milestone changed from 5.0.1 to 5.0.2

#4 @pento
6 months ago

  • Owner set to pento
  • Status changed from new to assigned

#5 @pento
6 months ago

In 44206:

REST API: Remove a duplicate require_once().

In WP_REST_Attachments_Controller::create_item(), wp-admin/includes/image.php was being require_once()-ed... twice. The superflous require_once() has been quietly removed.

Props david.binda.
See #45420.

#6 @pento
6 months ago

  • Keywords fixed-5.0 added

#7 @desrosj
6 months ago

  • Keywords commit removed

#8 @SergeyBiryukov
6 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 44309:

REST API: Remove a duplicate require_once().

In WP_REST_Attachments_Controller::create_item(), wp-admin/includes/image.php was being require_once()-ed... twice. The superflous require_once() has been quietly removed.

Props david.binda.
Merges [44206] to trunk.
Fixes #45420.

Note: See TracTickets for help on using tickets.