Skip to content

Commit

Permalink
check more char
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Aug 25, 2024
1 parent ed22cc7 commit e96319a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
from server.base import BadRequestException


_invalid_category = {"Cf", "Mn"}


def check_invalid_input_str(*s: str) -> None:
for ss in s:
for c in ss:
v = unicodedata.category(c)
if v == "Cf": # Format
print(repr(c), v)
if v in _invalid_category: # Format
raise BadRequestException("invalid character {!r}".format(c))

0 comments on commit e96319a

Please sign in to comment.