Make WordPress Core

Opened 2 months ago

Closed 2 weeks ago

Last modified 2 weeks ago

#59601 closed defect (bug) (fixed)

Infinte loop in Spy_REST_Server

Reported by: xknown's profile xknown Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.5 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch needs-testing
Focuses: Cc:


The Spy_REST_Server class is used to mock the REST API related unit tests. If for some random reason an undefined method is used on the rest_get_server() object (i.e. rest_get_server()->does_not_exist()), this results in a OOM error when running the WP unit tests.

Attachments (1)

59601.diff (1.0 KB) - added by xknown 2 months ago.

Download all attachments as: .zip

Change History (4)

2 months ago

#1 @joemcgill
2 months ago

  • Keywords has-patch needs-testing added
  • Milestone changed from Awaiting Review to Future Release

This looks good to me. Thanks @xknown. I'd like to get a second opinion but this looks good to commit whenever it's ready.

#2 @SergeyBiryukov
2 weeks ago

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

In 57133:

Tests: Avoid an infinite loop in Spy_REST_Server if a non-existing method is called.

Follow-up to [34928].

Props xknown, joemcgill.
Fixes #59601.

#3 @SergeyBiryukov
2 weeks ago

  • Milestone changed from Future Release to 6.5
Note: See TracTickets for help on using tickets.