WordPress.org

Make WordPress Core

Opened 7 months ago

Closed 7 months ago

Last modified 7 months ago

#49160 closed defect (bug) (invalid)

REST API: Characters escaped in response

Reported by: wpfed Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.7
Component: REST API Keywords:
Focuses: rest-api Cc:

Description

Example when writing test's you get in JSON response: test’s

Is this standard behavior, up to end-client to parse-decode?

Change History (5)

#1 follow-up: @TimothyBlynJacobs
7 months ago

  • Keywords reporter-feedback added
  • Version changed from 5.3.2 to 4.7

Hi @wpfed,

Thanks for the ticket! Could you provide a minimal reproducible test case? When I call wp_json_encode for 'test’s' I get back "test\u2019s".

#2 @SergeyBiryukov
7 months ago

Related/duplicate: #40560

#3 in reply to: ↑ 1 @wpfed
7 months ago

Replying to TimothyBlynJacobs:

Hi @wpfed,

Thanks for the ticket! Could you provide a minimal reproducible test case? When I call wp_json_encode for 'test’s' I get back "test\u2019s".

Thanks for getting back, for example if you paste this into your browser https://wptavern.com/wp-json/wp/v2/posts

Then you can see many instances of ’

#4 @wpfed
7 months ago

  • Resolution set to invalid
  • Status changed from new to closed

I think this can be closed and classified as "functions as expected"

#5 @SergeyBiryukov
7 months ago

  • Keywords reporter-feedback removed
  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.