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:
parent
639d789da1
commit
fc358b53c7
1 changed files with 3 additions and 0 deletions
|
|
@ -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;
|
||||||
|
|
|
||||||
Reference in a new issue