mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-14 00:26:51 +08:00
fix(youtube): Incomplete URL substring sanitization
This commit is contained in:
@@ -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=)([^#&?]*).*/;
|
||||
|
||||
Reference in New Issue
Block a user