summaryrefslogtreecommitdiff
path: root/internal/regexes
diff options
context:
space:
mode:
authorLibravatar decentral1se <1991377+decentral1se@users.noreply.github.com>2023-05-25 11:15:10 +0200
committerLibravatar GitHub <noreply@github.com>2023-05-25 11:15:10 +0200
commit45f961a9fe65127980e0e12a46ac4ac8f5b5752b (patch)
tree08d967c4b0b1c8863b9942afb04bfe9da0b66d33 /internal/regexes
parent[feature] Add List functionality (#1802) (diff)
downloadgotosocial-45f961a9fe65127980e0e12a46ac4ac8f5b5752b.tar.xz
[bugfix] allow usernames of length 1 (#1823)
Closes https://github.com/superseriousbusiness/gotosocial/issues/1691. Co-authored-by: decentral1se <cellarspoon@riseup.net>
Diffstat (limited to 'internal/regexes')
-rw-r--r--internal/regexes/regexes.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/regexes/regexes.go b/internal/regexes/regexes.go
index fe44980c5..88c832508 100644
--- a/internal/regexes/regexes.go
+++ b/internal/regexes/regexes.go
@@ -47,8 +47,8 @@ const (
mentionFinder = `(?:^|\s)(@` + usernameGrp + `+(?:@` + domainGrp + `+)?)` // Extract all mentions from a text, each mention may include domain.
emojiShortcode = `\w{2,30}` // Pattern for emoji shortcodes. maximumEmojiShortcodeLength = 30
emojiFinder = `(?:\b)?:(` + emojiShortcode + `):(?:\b)?` // Extract all emoji shortcodes from a text.
- usernameStrict = `^[a-z0-9_]{2,64}$` // Pattern for usernames on THIS instance. maximumUsernameLength = 64
- usernameRelaxed = `[a-z0-9_\.]{2,}` // Relaxed version of username that can match instance accounts too.
+ usernameStrict = `^[a-z0-9_]{1,64}$` // Pattern for usernames on THIS instance. maximumUsernameLength = 64
+ usernameRelaxed = `[a-z0-9_\.]{1,}` // Relaxed version of username that can match instance accounts too.
misskeyReportNotesFinder = `(?m)(?:^Note: ((?:http|https):\/\/.*)$)` // Extract reported Note URIs from the text of a Misskey report/flag.
ulid = `[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}` // Pattern for ULID.
ulidValidate = `^` + ulid + `$` // Validate one ULID.