fix: validate signatures and restore report metrics
This commit is contained in:
@@ -1990,9 +1990,12 @@ function normalizeSmsSignature(name: string) {
|
||||
}
|
||||
|
||||
function validateCompleteSmsSignature(name: string) {
|
||||
const value = name.trim();
|
||||
const value = name;
|
||||
if (/[\p{White_Space}\p{Cc}\p{Default_Ignorable_Code_Point}]/u.test(value)) {
|
||||
throw new BadRequestException('短信签名不能包含空格、换行或不可见字符');
|
||||
}
|
||||
const match = value.match(/^【([^【】]+)】$/);
|
||||
if (!match || match[1] !== match[1].trim()) {
|
||||
if (!match) {
|
||||
throw new BadRequestException('短信签名必须包含完整中文黑括号,例如:【某某科技】');
|
||||
}
|
||||
return value;
|
||||
|
||||
Reference in New Issue
Block a user