Changed the canonicalization and encoding to not use the CSS and JavaScript codecs, especially for canonicalization they cause problems with backslashes in strings which we generally want to allow and which generally isn't used in webapp input strings and I don't think we interpret such encodings anywhere so there is no danger nor utility for it; this better resolves the filename/etc problem reported by Jacques, so his temporary fix is now gone

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@746292 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
David E. Jones
2009-02-20 16:47:31 +00:00
parent 116e53b0d4
commit 368d99fa2d
2 changed files with 1 additions and 4 deletions
@@ -62,7 +62,7 @@ public class StringUtil {
public static final Validator defaultWebValidator;
static {
// possible codecs: CSSCodec, HTMLEntityCodec, JavaScriptCodec, MySQLCodec, OracleCodec, PercentCodec, UnixCodec, VBScriptCodec, WindowsCodec
List<Codec> codecList = Arrays.asList(new CSSCodec(), new HTMLEntityCodec(), new JavaScriptCodec(), new PercentCodec());
List<Codec> codecList = Arrays.asList(new HTMLEntityCodec(), new PercentCodec());
defaultWebEncoder = new DefaultEncoder(codecList);
defaultWebValidator = new DefaultValidator();
}
@@ -245,9 +245,6 @@ public class UtilHttp {
public static String canonicalizeParameter(String paramValue) {
try {
if (paramValue.startsWith(":\\", 1)) { // FIXME : more a hack than anything else
paramValue = paramValue.replace("\\", "/"); // This allows to use Windows paths from input fields
}
String cannedStr = StringUtil.defaultWebEncoder.canonicalize(paramValue, StringUtil.esapiCanonicalizeStrict);
if (Debug.verboseOn()) Debug.logVerbose("Canonicalized parameter with " + (cannedStr.equals(paramValue) ? "no " : "") + "change: original [" + paramValue + "] canned [" + cannedStr + "]", module);
return cannedStr;