name-color: shore up one of the last vulns

This commit is contained in:
mehbark 2024-07-11 02:25:30 -04:00
parent f7da042736
commit 8a5ff92104

View file

@ -45,7 +45,7 @@ async function get_name_color(name: string): Promise<string | undefined> {
if (text.startsWith("name-color: ")) { if (text.startsWith("name-color: ")) {
const color = text.split("name-color: ")[1] const color = text.split("name-color: ")[1]
.slice(0, MAX_COLOR_LEN) .slice(0, MAX_COLOR_LEN)
.replaceAll(";", ""); .replaceAll(/[;{}"']/g, "");
if (is_valid_color(color)) { if (is_valid_color(color)) {
return color; return color;
} else { } else {