Skip to content

Commit bdc2018

Browse files
committed
Merge pull request android-async-http#821 from Zlo/issue/820
RequestParams: Use Locale.US for String.format of machine readable strin...
2 parents b0d4fb7 + 4a1556a commit bdc2018

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

library/src/main/java/com/loopj/android/http/RequestParams.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import java.util.HashSet;
3939
import java.util.LinkedList;
4040
import java.util.List;
41+
import java.util.Locale;
4142
import java.util.Map;
4243
import java.util.Set;
4344
import java.util.concurrent.ConcurrentHashMap;
@@ -567,7 +568,7 @@ private List<BasicNameValuePair> getParamsList(String key, Object value) {
567568
if (nestedKey instanceof String) {
568569
Object nestedValue = map.get(nestedKey);
569570
if (nestedValue != null) {
570-
params.addAll(getParamsList(key == null ? (String) nestedKey : String.format("%s[%s]", key, nestedKey),
571+
params.addAll(getParamsList(key == null ? (String) nestedKey : String.format(Locale.US, "%s[%s]", key, nestedKey),
571572
nestedValue));
572573
}
573574
}
@@ -576,13 +577,13 @@ private List<BasicNameValuePair> getParamsList(String key, Object value) {
576577
List list = (List) value;
577578
int listSize = list.size();
578579
for (int nestedValueIndex = 0; nestedValueIndex < listSize; nestedValueIndex++) {
579-
params.addAll(getParamsList(String.format("%s[%d]", key, nestedValueIndex), list.get(nestedValueIndex)));
580+
params.addAll(getParamsList(String.format(Locale.US, "%s[%d]", key, nestedValueIndex), list.get(nestedValueIndex)));
580581
}
581582
} else if (value instanceof Object[]) {
582583
Object[] array = (Object[]) value;
583584
int arrayLength = array.length;
584585
for (int nestedValueIndex = 0; nestedValueIndex < arrayLength; nestedValueIndex++) {
585-
params.addAll(getParamsList(String.format("%s[%d]", key, nestedValueIndex), array[nestedValueIndex]));
586+
params.addAll(getParamsList(String.format(Locale.US, "%s[%d]", key, nestedValueIndex), array[nestedValueIndex]));
586587
}
587588
} else if (value instanceof Set) {
588589
Set set = (Set) value;

0 commit comments

Comments
 (0)