mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-06 22:02:04 -05:00
fix: code scanning alert no. 36: Incomplete URL substring sanitization (#4577)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: Dhruwang <dhruwangjariwala18@gmail.com>
This commit is contained in:
@@ -138,5 +138,10 @@ export const getAllowedFiles = (
|
||||
};
|
||||
|
||||
export const checkForYoutubePrivacyMode = (url: string): boolean => {
|
||||
return url.includes("youtube-nocookie.com");
|
||||
try {
|
||||
const parsedUrl = new URL(url);
|
||||
return parsedUrl.host === "www.youtube-nocookie.com";
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user