fix(youtube): Incomplete URL substring sanitization
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
export const isYoutubeUrl = (url?: string): boolean => {
|
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=)([^#&?]*).*/;
|
const _regexp = /.*(?:youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=)([^#&?]*).*/;
|
||||||
|
|||||||
Reference in New Issue
Block a user