Skip to content

Commit 54ffd54

Browse files
authored
fix: remove global flag from youtube regex (#485)
1 parent 524b4fc commit 54ffd54

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/frontend-main/src/utility/mediaUrls.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const TRUSTED_IMAGE_SOURCES = ['i.imgur.com', 'imgur.com'];
22
export const ALLOWED_IMAGE_EXTENSIONS = ['.png', '.jpg', '.jpeg', '.gif'];
3-
const YOUTUBE_REGEX = /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]{11})/g;
3+
const YOUTUBE_REGEX = /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([\w-]{11})/;
44

55
export function isFromTrustedDomain(url: string): boolean {
66
try {

0 commit comments

Comments
 (0)