Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#49160 closed defect (bug) (invalid)

REST API: Characters escaped in response

Reported by: wpfed's profile 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
4 years 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
4 years ago

Related/duplicate: #40560

#3 in reply to: ↑ 1 @wpfed
4 years 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
4 years 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
4 years ago

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