Trim content for possible evasion of hidden invalid chars.
This commit is contained in:
parent
23ddea0772
commit
17c21a0918
@ -62,6 +62,7 @@ public class SimpleConfig
|
|||||||
if (this.getFile().isFile())
|
if (this.getFile().isFile())
|
||||||
{
|
{
|
||||||
String content = DiscUtil.readCatch(this.getFile());
|
String content = DiscUtil.readCatch(this.getFile());
|
||||||
|
content = content.trim();
|
||||||
Object toShallowLoad = null;
|
Object toShallowLoad = null;
|
||||||
if (contentRequestsDefaults(content))
|
if (contentRequestsDefaults(content))
|
||||||
{
|
{
|
||||||
|
@ -113,6 +113,7 @@ public class DriverFlatfile extends DriverAbstract
|
|||||||
if (mtime == 0) return null;
|
if (mtime == 0) return null;
|
||||||
String content = DiscUtil.readCatch(file);
|
String content = DiscUtil.readCatch(file);
|
||||||
if (content == null) return null;
|
if (content == null) return null;
|
||||||
|
content = content.trim();
|
||||||
if (content.length() == 0) return null;
|
if (content.length() == 0) return null;
|
||||||
JsonElement raw = new JsonParser().parse(content);
|
JsonElement raw = new JsonParser().parse(content);
|
||||||
return new SimpleEntry<JsonElement, Long>(raw, mtime);
|
return new SimpleEntry<JsonElement, Long>(raw, mtime);
|
||||||
|
Loading…
Reference in New Issue
Block a user