diff options
Diffstat (limited to 'web/source/settings/admin/emoji/local/use-shortcode.js')
-rw-r--r-- | web/source/settings/admin/emoji/local/use-shortcode.js | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/web/source/settings/admin/emoji/local/use-shortcode.js b/web/source/settings/admin/emoji/local/use-shortcode.js index d18edac56..c9c27cdf2 100644 --- a/web/source/settings/admin/emoji/local/use-shortcode.js +++ b/web/source/settings/admin/emoji/local/use-shortcode.js @@ -24,7 +24,7 @@ const React = require("react"); const query = require("../../../lib/query"); const { useTextInput } = require("../../../lib/form"); -const shortcodeRegex = /^[a-z0-9_]+$/; +const shortcodeRegex = /^\w{2,30}$/; module.exports = function useShortcode() { const { @@ -48,12 +48,8 @@ module.exports = function useShortcode() { return "Shortcode must be between 2 and 30 characters"; } - if (code.toLowerCase() != code) { - return "Shortcode must be lowercase"; - } - if (!shortcodeRegex.test(code)) { - return "Shortcode must only contain lowercase letters, numbers, and underscores"; + return "Shortcode must only contain letters, numbers, and underscores"; } return ""; |