Compare commits

...
Author SHA1 Message Date
Shivam Mishra 729a551571 fix: email sanitizer 2025-08-21 14:40:15 +05:30
+4 -3
View File
@@ -60,15 +60,16 @@ const sanitizeURL = url => {
const parsedURL = new URL(url); const parsedURL = new URL(url);
// filter out dangerous protocols like `javascript`, `data`, `vbscript` // filter out dangerous protocols like `javascript`, `data`, `vbscript`
if (!['https', 'http'].includes(parsedURL.protocol)) { if (!['https:', 'http:'].includes(parsedURL.protocol)) {
throw new Error('Invalid Protocol'); throw new Error('Invalid Protocol');
} }
return url; // Return the original valid URL
} catch (e) { } catch (e) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.error('Invalid URL', e); console.error('Invalid URL', e);
return 'about:blank'; // Only return blank for invalid URLs
} }
return 'about:blank'; // blank page URL
}; };
export const IFrameHelper = { export const IFrameHelper = {