Fixed: Getting policy error while editing html text data using cms

(OFBIZ-11265)

Service parameter with allow-html="safe" does not check the OWASP sanitizer flag
ie. enabled or not and perform sanitization which causing policy error while
editing text data

getting following exception error:
"In field [textData] by our input policy, your input has not been accepted for
security reason. Please check and modify accordingly, thanks."

Thanks: Pradeep Choudhary for report and suggestion
(cherry picked from commit 8aea160e04)
This commit is contained in:
Jacques Le Roux
2019-11-07 15:48:15 +01:00
parent f062329810
commit 1c27d21260
4 changed files with 10 additions and 4 deletions
@@ -439,7 +439,10 @@ public class UtilCodec {
* @param locale
*/
public static String checkStringForHtmlSafe(String valueName, String value, List<String> errorMessageList,
Locale locale) {
Locale locale, boolean enableSanitizer) {
if (!enableSanitizer) {
return value;
}
PolicyFactory policy = null;
try {
Class<?> customPolicyClass = null;