Skip to content

Commit 870cd5c

Browse files
Potential fix for code scanning alert no. 66: Incomplete URL scheme check
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent c411969 commit 870cd5c

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

recoco/frontend/src/js/store/onLeaveAlert.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,14 @@ Alpine.store('onLeaveAlert', {
6161
if (link.hasAttribute('aria-controls')) return;
6262

6363
const href = link.getAttribute('href');
64-
if (!href || href.startsWith('#') || href.startsWith('javascript:'))
64+
const normalizedHref = href ? href.trim().toLowerCase() : '';
65+
if (
66+
!href ||
67+
normalizedHref.startsWith('#') ||
68+
normalizedHref.startsWith('javascript:') ||
69+
normalizedHref.startsWith('data:') ||
70+
normalizedHref.startsWith('vbscript:')
71+
)
6572
return;
6673

6774
event.preventDefault();

0 commit comments

Comments
 (0)