fix(youtube): Incomplete URL substring sanitization

This commit is contained in:
tzhangchi committed 2022-08-17 10:14:34 +08:00
1 parent f54274442c
commit 8864593882
2 files changed
+2 -1

No files matched your search

@@ -1,5 +1,6 @@
export const isYoutubeUrl = (url?: string): boolean => {
return url.includes('youtu.be') || url.includes('youtube.com');
const allowedHosts = ['youtu.be', 'youtube.com'];
return allowedHosts.includes(url);
};
const _regexp = /.*(?:youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=)([^#&?]*).*/;
View File
Whitespace-only changes.