Encode <, >, ', &, and " using the json_encode() options parameter

Created on 6 December 2021, almost 3 years ago
Updated 28 April 2023, over 1 year ago

Problem/Motivation

Drupal REST export returns \u0026gt; or \u0026amp;.
This module returns &gt; ot &amp; so the data is rendered incorrectly.

Steps to reproduce

Add content with <, >, ', &, and ".

Proposed resolution

json_encode($results, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT);

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇵🇱Poland Krzysztof Domański Poland

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024