You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can you please explain how you are using AntiSamy to do this? We need more details to be able to review/respond appropriately. cc @spassarop
When using AntiSamy as an XSS filter, if your input parameters contain JSON strings and you want to avoid converting escaped characters like " back to " after processing, here's the solution:
Problem Analysis
AntiSamy automatically escapes special characters to sanitize HTML/XML contexts. However, this breaks JSON validity if the input is a JSON string (e.g., {"key":"value"} becomes {"key":"value"}).
@aduoer - Can you edit your response to properly escape it, because all your encoded stuff is decoded automatically when viewing it. You need to look at the 'Preview' view to make sure it looks like you intend.
Input: {
"names":"["alex","bob"]"
}
Expected output: {
"names":"["alex","bob"]"
}
Current output: {
"names":"[&quto;alex&quto;,&quto;bob&quto;]"
}
antisamy version: 1.7.7
The text was updated successfully, but these errors were encountered: