Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#52802 closed defect (bug) (invalid)

Possible typo in rest_validate_enum() function

Reported by: hareesh-pillai's profile Hareesh Pillai Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.7
Component: REST API Keywords:
Focuses: Cc:

Description

There seems to be a typo in the return statement of rest_validate_enum() function. See L1965.

Instead of %1$s is not one of %2$l, it should be %1$s is not one of %2$s.

Introduced in #51911.

Change History (1)

#1 @SergeyBiryukov
4 years ago

  • Component changed from General to REST API
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Thanks for the ticket!

The %2$l placeholder is not a typo, it's meant for outputting localized lists of items. See the wp_sprintf_l() function for more details, attached via a filter to wp_sprintf().

The $encoded_enum_values variable there is an array, so %2$s won't work as expected.

Note: See TracTickets for help on using tickets.