Skip to content
Permalink
Browse files

Improved: Remove useless null check

(OFBIZ-10054)

Additionally the noisy ‘final’ modifiers on local variables have been
removed because local variables should be final by default and mutable
by exception.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1859081 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mthl committed May 10, 2019
1 parent a8f3480 commit a0ac6ae33146ddcc99ce0f0d06f45d3d7da596cd
Showing with 4 additions and 6 deletions.
  1. +4 −6 framework/base/src/main/java/org/apache/ofbiz/base/util/UtilCodec.java
@@ -396,12 +396,10 @@ public static String checkStringForHtmlStrictNone(String valueName, String value
}

// check for js events
final String onEvent = "on" + StringUtils.substringBetween(value, " on", "=");
final boolean seekSegmentTime = value.contains("seekSegmentTime");
if (null != onEvent || seekSegmentTime) {
if (jsEventList.stream().anyMatch(str -> StringUtils.containsIgnoreCase(str, onEvent)) || seekSegmentTime) {
errorMessageList.add("In field [" + valueName + "] js events are not allowed.");
}
String onEvent = "on" + StringUtils.substringBetween(value, " on", "=");
boolean seekSegmentTime = value.contains("seekSegmentTime");
if (jsEventList.stream().anyMatch(str -> StringUtils.containsIgnoreCase(str, onEvent)) || seekSegmentTime) {
errorMessageList.add("In field [" + valueName + "] js events are not allowed.");
}

// TODO: anything else to check for that can be used to get HTML or JavaScript going without these characters?

0 comments on commit a0ac6ae

Please sign in to comment.
You can’t perform that action at this time.