commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1455867 - in /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload: ParameterParser.java util/FileItemHeadersImpl.java
Date Wed, 13 Mar 2013 10:26:22 GMT
Author: simonetripodi
Date: Wed Mar 13 10:26:21 2013
New Revision: 1455867

URL: http://svn.apache.org/r1455867
Log:
[FILEUPLOAD-229] If an actual lower/upper case is required, then should use a fixed locale
(unless the code is intended to use the default locale, which is quite unusual for Commons).
A suitable locale is Locale.ENGLISH as that behaves well with ASCII and ISO-8859-1.

Modified:
    commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/ParameterParser.java
    commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/FileItemHeadersImpl.java

Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/ParameterParser.java
URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/ParameterParser.java?rev=1455867&r1=1455866&r2=1455867&view=diff
==============================================================================
--- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/ParameterParser.java
(original)
+++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/ParameterParser.java
Wed Mar 13 10:26:21 2013
@@ -18,6 +18,7 @@ package org.apache.commons.fileupload;
 
 import java.io.UnsupportedEncodingException;
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.Map;
 
 import javax.mail.internet.MimeUtility;
@@ -328,7 +329,7 @@ public class ParameterParser {
             }
             if ((paramName != null) && (paramName.length() > 0)) {
                 if (this.lowerCaseNames) {
-                    paramName = paramName.toLowerCase();
+                    paramName = paramName.toLowerCase(Locale.ENGLISH);
                 }
 
                 params.put(paramName, paramValue);

Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/FileItemHeadersImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/FileItemHeadersImpl.java?rev=1455867&r1=1455866&r2=1455867&view=diff
==============================================================================
--- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/FileItemHeadersImpl.java
(original)
+++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/util/FileItemHeadersImpl.java
Wed Mar 13 10:26:21 2013
@@ -22,6 +22,7 @@ import java.util.Collections;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 
 import org.apache.commons.fileupload.FileItemHeaders;
@@ -50,7 +51,7 @@ public class FileItemHeadersImpl impleme
      * {@inheritDoc}
      */
     public String getHeader(String name) {
-        String nameLower = name.toLowerCase();
+        String nameLower = name.toLowerCase(Locale.ENGLISH);
         List<String> headerValueList = headerNameToValueListMap.get(nameLower);
         if (null == headerValueList) {
             return null;



Mime
View raw message