Skip to content

Commit

Permalink
Fixed: Fix linting issues
Browse files Browse the repository at this point in the history
(OFBIZ-11265)
  • Loading branch information
mthl committed Nov 8, 2019
1 parent 3d3533c commit 03b69b3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ checkstyle {
// the sum of errors that were present before introducing the
// ‘checkstyle’ tool present in the framework and in the official
// plugins.
tasks.checkstyleMain.maxErrors = 37780
tasks.checkstyleMain.maxErrors = 37776
// Currently there are a lot of errors so we need to temporarily
// hide them to avoid polluting the terminal output.
showViolations = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ private static void checkStringForHtmlStrictNoneTest(String label, String fixed,
public void testCheckStringForHtmlSafe() {
String xssVector = "<script>alert('XSS vector');</script>";
List<String> errorList = new ArrayList<>();
String canonicalizedXssVector = UtilCodec.checkStringForHtmlSafe("fieldName", xssVector, errorList,new Locale("test"), true);
String canonicalizedXssVector = UtilCodec.checkStringForHtmlSafe("fieldName", xssVector, errorList,
new Locale("test"), true);
assertEquals("<script>alert('XSS vector');</script>", canonicalizedXssVector);
assertEquals(1, errorList.size());
assertEquals("In field [fieldName] by our input policy, your input has not been accepted for security reason. "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -614,8 +614,8 @@ public void validate(Map<String, Object> context, String mode, Locale locale) th
if ("none".equals(modelParam.allowHtml)) {
UtilCodec.checkStringForHtmlStrictNone(modelParam.name, value, errorMessageList, (Locale) context.get("locale"));
} else if ("safe".equals(modelParam.allowHtml)) {
UtilCodec.checkStringForHtmlSafe(modelParam.name, value, errorMessageList,
(Locale) context.get("locale"),
UtilCodec.checkStringForHtmlSafe(modelParam.name, value, errorMessageList,
(Locale) context.get("locale"),
EntityUtilProperties.getPropertyAsBoolean("owasp", "sanitizer.enable", true));
}
}
Expand Down

0 comments on commit 03b69b3

Please sign in to comment.