Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#49160 closed defect (bug) (invalid)

REST API: Characters escaped in response

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

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 years ago

  • Keywords reporter-feedback added
  • Version 5.3.2 → 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 years ago

Related/duplicate: #40560

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

  • Resolution → invalid
  • Status new → closed

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

#5 @SergeyBiryukov
7 years ago

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