mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix decoder bug
This commit is contained in:
parent
91de866ffa
commit
ce1c0bab45
@ -88,11 +88,6 @@ public class URLDecoder implements Serializable {
|
||||
char c;
|
||||
for (int i = 0; i < length; i++) {
|
||||
c = str.charAt(i);
|
||||
if('+' == c){
|
||||
result.append(isPlusToSpace ? CharUtil.SPACE : c);
|
||||
begin++;
|
||||
continue;
|
||||
}
|
||||
if(ESCAPE_CHAR == c || CharUtil.isHexChar(c)){
|
||||
continue;
|
||||
}
|
||||
@ -103,6 +98,11 @@ public class URLDecoder implements Serializable {
|
||||
result.append(decodeSub(str, begin, i, charset, isPlusToSpace));
|
||||
}
|
||||
|
||||
// 非Hex字符,忽略本字符
|
||||
if('+' == c && isPlusToSpace){
|
||||
c = CharUtil.SPACE;
|
||||
}
|
||||
|
||||
// 非Hex字符,忽略本字符
|
||||
result.append(c);
|
||||
begin = i + 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user