Skip to content

Commit 6a17e19

Browse files
committed
fix(matrix_lobby_bypass): regex
1 parent ebf8a82 commit 6a17e19

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

auth_hybrid_matrix_token/mod_matrix_lobby_bypass.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
-- room name to understand if this room is created by widget or not...
77
--
88
-- There are two possible formats for Jitsi room names created by widget:
9-
-- - jitsi_room_name should match "jitsi[a-z]{24}" (regex) or
10-
-- - base32.decode(jitsi_room_name) should match "!.*:.*[.].*" (regex)
9+
-- - jitsi_room_name should match "^jitsi[a-z]{24}$" (regex) or
10+
-- - base32.decode(jitsi_room_name) should match "^!.*:.*[.].*" (regex)
1111
--
1212
-- If the participant is already a valid member of Matrix's room then no need to
1313
-- check her again in Jitsi lobby.
@@ -38,7 +38,7 @@ module:hook("muc-occupant-pre-join", function (event)
3838
local roomName, _ = jid_split(room.jid)
3939
local isMatrixRoomName = string.match(
4040
roomName,
41-
"jitsi%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l"
41+
"^jitsi%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l$"
4242
)
4343

4444
-- if it doesnt match the first format, check the second possible format
@@ -49,7 +49,7 @@ module:hook("muc-occupant-pre-join", function (event)
4949
return
5050
end
5151

52-
local isMatrixRoomId = string.match(roomId, "!.*:.*[.].*")
52+
local isMatrixRoomId = string.match(roomId, "^!.*:.*[.].*")
5353
if not isMatrixRoomId then
5454
module:log(LOGLEVEL, "skip lobby_bypass, not a Matrix room")
5555
return

0 commit comments

Comments
 (0)