mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Sanitize ResourceLocation error logging
This commit is contained in:
parent
b67ec825d2
commit
37bc4f0b04
1 changed files with 18 additions and 0 deletions
|
@ -8,3 +8,21 @@
|
|||
private final String namespace;
|
||||
private final String path;
|
||||
|
||||
@@ -246,7 +247,7 @@
|
||||
|
||||
private static String assertValidNamespace(String namespace, String path) {
|
||||
if (!isValidNamespace(namespace)) {
|
||||
- throw new ResourceLocationException("Non [a-z0-9_.-] character in namespace of location: " + namespace + ":" + path);
|
||||
+ throw new ResourceLocationException("Non [a-z0-9_.-] character in namespace of location: " + org.apache.commons.lang3.StringUtils.normalizeSpace(namespace) + ":" + org.apache.commons.lang3.StringUtils.normalizeSpace(path)); // Paper - Sanitize ResourceLocation error logging
|
||||
} else {
|
||||
return namespace;
|
||||
}
|
||||
@@ -267,7 +268,7 @@
|
||||
|
||||
private static String assertValidPath(String namespace, String path) {
|
||||
if (!isValidPath(path)) {
|
||||
- throw new ResourceLocationException("Non [a-z0-9/._-] character in path of location: " + namespace + ":" + path);
|
||||
+ throw new ResourceLocationException("Non [a-z0-9/._-] character in path of location: " + namespace + ":" + org.apache.commons.lang3.StringUtils.normalizeSpace(path)); // Paper - Sanitize ResourceLocation error logging
|
||||
} else {
|
||||
return path;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue