Strip control characters from JSON body in saveWizard

Lucee's deserializeJSON chokes on control characters in description
fields that JSON.stringify escapes but Lucee can't parse.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
John Mizerek 2026-03-09 13:11:20 -07:00
parent 639d789da1
commit fc358b53c7

View file

@ -142,6 +142,9 @@ try {
throw(message="No request body provided"); throw(message="No request body provided");
} }
// Clean control characters that Lucee's JSON parser can't handle
requestBody = reReplace(requestBody, "[\x00-\x08\x0B\x0C\x0E-\x1F]", "", "all");
data = deserializeJSON(requestBody); data = deserializeJSON(requestBody);
businessId = structKeyExists(data, "businessId") ? val(data.businessId) : 0; businessId = structKeyExists(data, "businessId") ? val(data.businessId) : 0;