fix string to map generation with base64 encoding
The new base64 encoding uses "=" characters as part of its encoding.
The previous code split those and trimmed them afterwards, making the
base64 not consistent with the rest of the code that assumed "=" are
still present, like "B64:e30=".
(cherry picked from commit de324a23be)
This commit is contained in:
parent
d657c7a819
commit
db4af71215
|
|
@ -11,8 +11,15 @@ public class LocalJsonUtil {
|
|||
String[] split = s2.split(",");
|
||||
for (int i = split.length - 1; i >= 0; i--) {
|
||||
String trim = split[i].trim();
|
||||
String[] split1 = trim.split("=");
|
||||
map.put(split1[0],split1[1]);
|
||||
|
||||
// only check for the first "=" as the values also contain additional "="
|
||||
int equalIndex = trim.indexOf('=');
|
||||
if (equalIndex < 0)
|
||||
continue;
|
||||
|
||||
String key = trim.substring(0, equalIndex);
|
||||
String value = trim.substring(equalIndex + 1);
|
||||
map.put(key, value);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
|
@ -24,8 +31,15 @@ public class LocalJsonUtil {
|
|||
String[] split = s2.split(",");
|
||||
for (int i = split.length - 1; i >= 0; i--) {
|
||||
String trim = split[i].trim();
|
||||
String[] split1 = trim.split("=");
|
||||
map.put(Integer.parseInt(split1[0]),split1[1]);
|
||||
|
||||
// only check for the first "=" as the values also contain additional "="
|
||||
int equalIndex = trim.indexOf('=');
|
||||
if (equalIndex < 0)
|
||||
continue;
|
||||
|
||||
String key = trim.substring(0, equalIndex);
|
||||
String value = trim.substring(equalIndex + 1);
|
||||
map.put(Integer.parseInt(key), value);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user