We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f436be commit c5d29b2Copy full SHA for c5d29b2
1 file changed
src/lib/isURL.js
@@ -58,7 +58,9 @@ export default function isURL(url, options) {
58
if (!url || /[\s<>]/.test(url)) {
59
return false;
60
}
61
- if (url.indexOf('mailto:') === 0) {
+ const lowerUrl = url.trim().toLowerCase();
62
+ const dangerousSchemes = ['javascript:', 'data:', 'vbscript:', 'file:', 'blob:', 'mailto:'];
63
+ if (dangerousSchemes.some(scheme => lowerUrl.startsWith(scheme))) {
64
65
66
options = merge(options, default_url_options);
0 commit comments