mirror of
https://github.com/oceanprotocol/market.git
synced 2024-06-28 00:27:49 +02:00
1fcc3b1356
* sanitize url on DebugEditMetadata as code scanning suggestion * sanitize urls
11 lines
236 B
TypeScript
11 lines
236 B
TypeScript
export function sanitizeUrl(url: string) {
|
|
const u = decodeURI(url).trim().toLowerCase()
|
|
if (
|
|
u.startsWith('javascript:') ||
|
|
u.startsWith('data:') ||
|
|
u.startsWith('vbscript:')
|
|
)
|
|
return 'about:blank'
|
|
return url
|
|
}
|