core: settings: add extra validation

This commit is contained in:
undefined committed 2026-08-23 04:12:00 +00:00
1 parent 08ef44fa36
commit 50b105d5d1
1 file changed
+2
+2
View File
@@ -390,9 +390,11 @@ function set(s: Setting, key: string, value: any) {
if (value) {
if (['json', 'yaml', 'markdown', 'textarea'].includes(s.type)) {
if (!Types.Content[1](value)) throw new ValidationError(key);
return Types.Content[0](value);
}
if (s.type === 'text') {
if (!Types.ShortString[1](value)) throw new ValidationError(key);
return Types.ShortString[0](value);
}
}
if (s.subType === 'yaml') {