api/utils/cleanString: add more forbidden chars

This commit is contained in:
wukko 2024-11-24 14:55:10 +06:00
parent da5cd3e324
commit 6a430545d2
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2

View file

@ -1,4 +1,4 @@
const forbiddenCharsString = ['}', '{', '%', '>', '<', '^', ';', '`', '$', '"', "@", '='];
const forbiddenCharsString = ['}', '{', '%', '>', '<', '^', ';', ':', '`', '$', '"', "@", '=', '?', '|', '*'];
export function metadataManager(obj) {
const keys = Object.keys(obj);
@ -21,7 +21,7 @@ export function metadataManager(obj) {
export function cleanString(string) {
for (const i in forbiddenCharsString) {
string = string.replaceAll("/", "_")
string = string.replaceAll("/", "_").replaceAll("\\", "_")
.replaceAll(forbiddenCharsString[i], '')
}
return string;