Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 300530

REST views: double encoding of apostrophes in REST Export display

$
0
0

In the below sample of a REST export view output in JSON format, you can see that an apostrophe character (ASCII code 39) is double encoded in the form of "\u0026#039;".

[{"book_background_pattern":"\/sites\/default\/files\/a_visit_to\/background_images\/avt_s18_background_pattern.jpg","cover":"\/sites\/default\/files\/a_visit_to\/background_images\/avt_doc_S18_cover.jpg","dark_color":"0073b9","accent_color":"a92825","light_color":"c7d5ee","header_background":"\/sites\/default\/files\/a_visit_to\/background_images\/avt_s18_header.png","title":"The Doctor\u0026#039;s Office: A 4D Book","vuforia_device_database":"\/sites\/default\/files\/a_visit_to\/doctors_office\/targets\/a_visit_to_doctors_office.zip","id":"8799","author":"Blake A. Hoena","illustrator":"","series":"A Visit to...","series_id":"268"}]

Steps to reproduce:

  1. Create a node with a title containing an apostrophe character.
  2. Create a view containing a REST Export display.
  3. Set the view format to "Fields."
  4. Add the "Content:Title" field to the field list.
  5. Preview the results of the view.
  6. Observe that the apostrophe character is double encoded.

Viewing all articles
Browse latest Browse all 300530

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>