mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-06 15:41:38 +01:00
Sanitize ResourceLocation error logging
This commit is contained in:
parent
b67ec825d2
commit
37bc4f0b04
@ -8,3 +8,21 @@
|
|||||||
private final String namespace;
|
private final String namespace;
|
||||||
private final String path;
|
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 New Issue
Block a user