[bugfix] Allow lowercase emoji shortcode in frontend (#1851)

* Replace pinafore with semaphore

* Typo

* Allow lowercase emoji shortcode in frontend

* Fix failing test (corrected expected outcome)
This commit is contained in:
Julian-Samuel Gebühr
2023-06-02 17:42:14 +02:00
committed by GitHub
parent 2358cf4e43
commit 1f39275c0f
6 changed files with 8 additions and 12 deletions

View File

@ -179,10 +179,10 @@ func CustomCSS(customCSS string) error {
// EmojiShortcode just runs the given shortcode through the regular expression
// for emoji shortcodes, to figure out whether it's a valid shortcode, ie., 2-30 characters,
// lowercase a-z, numbers, and underscores.
// a-zA-Z, numbers, and underscores.
func EmojiShortcode(shortcode string) error {
if !regexes.EmojiShortcode.MatchString(shortcode) {
return fmt.Errorf("shortcode %s did not pass validation, must be between 2 and 30 characters, lowercase letters, numbers, and underscores only", shortcode)
return fmt.Errorf("shortcode %s did not pass validation, must be between 2 and 30 characters, letters, numbers, and underscores only", shortcode)
}
return nil
}