Skip to content

Commit

Permalink
Merge pull request #41123 from GandalfGwaihir/issue40968
Browse files Browse the repository at this point in the history
[Fix]: Regex and Limit of Room Title were limited to 79 characters due to `BE` constraints
  • Loading branch information
dangrous authored May 3, 2024
2 parents 30f7cf9 + 9862f92 commit aa9c279
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ const CONST = {
},
RESERVED_ROOM_NAMES: ['#admins', '#announce'],
MAX_PREVIEW_AVATARS: 4,
MAX_ROOM_NAME_LENGTH: 79,
MAX_ROOM_NAME_LENGTH: 99,
LAST_MESSAGE_TEXT_MAX_LENGTH: 200,
OWNER_EMAIL_FAKE: '__FAKE__',
OWNER_ACCOUNT_ID_FAKE: 0,
Expand Down Expand Up @@ -1856,7 +1856,7 @@ const CONST = {
CARD_NUMBER: /^[0-9]{15,16}$/,
CARD_SECURITY_CODE: /^[0-9]{3,4}$/,
CARD_EXPIRATION_DATE: /^(0[1-9]|1[0-2])([^0-9])?([0-9]{4}|([0-9]{2}))$/,
ROOM_NAME: /^#[\p{Ll}0-9-]{1,80}$/u,
ROOM_NAME: /^#[\p{Ll}0-9-]{1,100}$/u,

// eslint-disable-next-line max-len, no-misleading-character-class
EMOJI: /[\p{Extended_Pictographic}\u200d\u{1f1e6}-\u{1f1ff}\u{1f3fb}-\u{1f3ff}\u{e0020}-\u{e007f}\u20E3\uFE0F]|[#*0-9]\uFE0F?\u20E3/gu,
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/ValidationUtilsTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ describe('ValidationUtils', () => {
expect(ValidationUtils.isValidRoomName('#')).toBe(false);
});

test('room name with 81 characters', () => {
expect(ValidationUtils.isValidRoomName('#123456789012345678901234567890123456789012345678901234567890123456789012345678901')).toBe(false);
test('room name with 101 characters', () => {
expect(ValidationUtils.isValidRoomName('#12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901')).toBe(false);
});

test('room name with lowercase letters, numbers, and dashes', () => {
Expand Down

0 comments on commit aa9c279

Please sign in to comment.