From b5685ed3d41f9c8d69029c4c6218b2d00b045d77 Mon Sep 17 00:00:00 2001 From: Daniel Kulp Date: Wed, 18 Mar 2020 08:33:46 -0400 Subject: [PATCH] JONObject#quote should escape U+2028 and U+2029 Patch from pvojtechovsky applied Fixes #19 --- src/main/java/org/codehaus/jettison/json/JSONObject.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/org/codehaus/jettison/json/JSONObject.java b/src/main/java/org/codehaus/jettison/json/JSONObject.java index 6ae2bb5..d76d65d 100644 --- a/src/main/java/org/codehaus/jettison/json/JSONObject.java +++ b/src/main/java/org/codehaus/jettison/json/JSONObject.java @@ -1050,6 +1050,12 @@ public static String quote(String string, boolean escapeForwardSlashAlways) { case '\r': sb.append("\\r"); break; + case '\u2028': + sb.append("\\u2028"); + break; + case '\u2029': + sb.append("\\u2029"); + break; default: if (c < ' ') { t = "000" + Integer.toHexString(c);