fix(youtube): Incomplete URL substring sanitization

This commit is contained in:
tzhangchi
2022-08-17 10:14:34 +08:00
parent f54274442c
commit 8864593882
2 changed files with 2 additions and 1 deletions
@@ -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