WordPress.org

Make WordPress Core

Opened 2 months ago

Last modified 8 weeks ago

#54240 new defect (bug)

WP REST API Users Endpoint Search

Reported by: damianem Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.8.1
Component: REST API Keywords: has-patch reporter-feedback
Focuses: rest-api Cc:

Description

The WP REST API Users endpoint doesn't support plus addresses when searching using the search parameter - /wp-json/wp/v2/users/?search=example+label@…

Plus addressing is a handy Google Workspace and Office 365 feature that I'm noticing adoption of more and more.

Attachments (1)

54240.diff (717 bytes) - added by sabbirshouvo 8 weeks ago.
add urlencode for user search rest api param value

Download all attachments as: .zip

Change History (6)

#1 @swissspidy
2 months ago

Have you tried properly encode the email address because of the plus sign? e.g. ?search=example%2Blabel...

#2 @sabbirshouvo
8 weeks ago

@swissspidy I think you got it wrong. Plus addressing is like adding a random string to your email following by a + before @tld and still getting the email delivered in the original email address. For example my email is sabbir@domain.com, a plus address can be like sabbir+wordpress@domain.com

@damianem users in wordpress should have a valid email address. Also I don't see any valid reason to adopt plus addressing support rest-api use fetching.

@swissspidy for automatically encoding search param value we can urlencode the input value. I'll add a patch for that.

@sabbirshouvo
8 weeks ago

add urlencode for user search rest api param value

#3 @swissspidy
8 weeks ago

I know what plus addressing is.

What I am saying is @damianem should urlencode the email address in their code/browser before making the REST API request.

Because if you don't do that, the plus sign in /wp-json/wp/v2/users/?search=example+label@… might be interpreted as a space character.

#4 @sabbirshouvo
8 weeks ago

  • Keywords has-patch added

#5 @swissspidy
8 weeks ago

  • Keywords reporter-feedback added
Note: See TracTickets for help on using tickets.