Skip to content

Commit 059aae2

Browse files
Fix code scanning alert no. 1: Incomplete URL scheme check
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 6b9efb4 commit 059aae2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: src/utils/permalinks.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ export const getPermalink = (slug = '', type = 'page'): string => {
4747
slug.startsWith('http://') ||
4848
slug.startsWith('://') ||
4949
slug.startsWith('#') ||
50-
slug.startsWith('javascript:')
50+
slug.trim().toLowerCase().startsWith('javascript:') ||
51+
slug.trim().toLowerCase().startsWith('data:') ||
52+
slug.trim().toLowerCase().startsWith('vbscript:')
5153
) {
5254
return slug;
5355
}

0 commit comments

Comments
 (0)