mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 12:22:25 -05:00
[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:
parent
2358cf4e43
commit
1f39275c0f
6 changed files with 8 additions and 12 deletions
|
|
@ -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 "";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue