mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix JSONUtil.isJson
This commit is contained in:
@@ -801,7 +801,7 @@ public final class JSONUtil {
|
||||
if (StrUtil.isBlank(str)) {
|
||||
return false;
|
||||
}
|
||||
return StrUtil.isWrap(str.trim(), '{', '}');
|
||||
return StrUtil.isWrap(StrUtil.trim(str), '{', '}');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -815,7 +815,7 @@ public final class JSONUtil {
|
||||
if (StrUtil.isBlank(str)) {
|
||||
return false;
|
||||
}
|
||||
return StrUtil.isWrap(str.trim(), '[', ']');
|
||||
return StrUtil.isWrap(StrUtil.trim(str), '[', ']');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -179,4 +179,4 @@ public class JSONUtilTest {
|
||||
" \"test\": \"\\\\地库地库\",\n" +
|
||||
"}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user