Skip to content

Commit

Permalink
Merge pull request #6 from UnicodeDigital/alert-autofix-1
Browse files Browse the repository at this point in the history
Fix code scanning alert no. 1: Incomplete URL scheme check
  • Loading branch information
Billy1900 authored Oct 14, 2024
2 parents 6b9efb4 + 059aae2 commit e22f1f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/permalinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ export const getPermalink = (slug = '', type = 'page'): string => {
slug.startsWith('http://') ||
slug.startsWith('://') ||
slug.startsWith('#') ||
slug.startsWith('javascript:')
slug.trim().toLowerCase().startsWith('javascript:') ||
slug.trim().toLowerCase().startsWith('data:') ||
slug.trim().toLowerCase().startsWith('vbscript:')
) {
return slug;
}
Expand Down

0 comments on commit e22f1f7

Please sign in to comment.