fix: frontend security risk (#2355)
This commit is contained in:
parent
a8f23ed712
commit
a667d04e53
32 changed files with 59 additions and 53 deletions
|
|
@ -30,3 +30,10 @@ export function randomString(length: number) {
|
|||
for (let i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)]
|
||||
return result
|
||||
}
|
||||
|
||||
export const getPurifyHref = (href: string) => {
|
||||
if (!href)
|
||||
return ''
|
||||
|
||||
return href.replace(/javascript:/ig, '').replace(/vbscript:/ig, '').replace(/data:/ig, '')
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue