mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-04-15 14:54:06 +00:00
Restricing REMOTENAME regex to just RFC 7565 characters that are URI safe
This commit is contained in:
parent
c9406c40a4
commit
1d873a37cb
1 changed files with 1 additions and 4 deletions
|
@ -3,10 +3,7 @@
|
|||
DOMAIN = r"[\w_\-\.]+\.[a-z\-]{2,}"
|
||||
LOCALNAME = r"@?[a-zA-Z_\-\.0-9]+"
|
||||
STRICT_LOCALNAME = r"@[a-zA-Z_\-\.0-9]+"
|
||||
REMOTENAME = (
|
||||
r"[\w\-\.\~\!\$\&\'\(\)\*\+\,\;\=]"
|
||||
r"(?:[\w\-\.\~\!\$\&\'\(\)\*\+\,\;\=]|(?:%[0-9A-Fa-f]{2})){0,149}"
|
||||
)
|
||||
REMOTENAME = r"[\w\-\.\~](?:[\w\-\.\~]|(?:%[0-9A-Fa-f]{2})){0,149}"
|
||||
USERNAME = rf"{LOCALNAME}(@{DOMAIN})?"
|
||||
STRICT_USERNAME = rf"(\B{STRICT_LOCALNAME}(@{DOMAIN})?\b)"
|
||||
FULL_USERNAME = rf"{LOCALNAME}@{DOMAIN}\b"
|
||||
|
|
Loading…
Reference in a new issue