Skip to content

Commit

Permalink
Get rid of stray == 0 in XSS checks
Browse files Browse the repository at this point in the history
  • Loading branch information
evancz committed Apr 6, 2018
1 parent 3b4c120 commit 06ce9cc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Elm/Kernel/VirtualDom.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,24 +283,24 @@ function _VirtualDom_noInnerHtmlOrFormAction(key)

function _VirtualDom_noJavaScriptUri__PROD(value)
{
return /^\s*javascript:/i.test(value) == 0 ? '' : value;
return /^\s*javascript:/i.test(value) ? '' : value;
}

function _VirtualDom_noJavaScriptUri__DEBUG(value)
{
return /^\s*javascript:/i.test(value) == 0
return /^\s*javascript:/i.test(value)
? 'javascript:alert("This is an XSS vector. Please use ports or web components instead.")'
: value;
}

function _VirtualDom_noJavaScriptOrHtmlUri__PROD(value)
{
return /^\s*(javascript:|data:text\/html)/i.test(value) == 0 ? '' : value;
return /^\s*(javascript:|data:text\/html)/i.test(value) ? '' : value;
}

function _VirtualDom_noJavaScriptOrHtmlUri__DEBUG(value)
{
return /^\s*(javascript:|data:text\/html)/i.test(value) == 0
return /^\s*(javascript:|data:text\/html)/i.test(value)
? 'javascript:alert("This is an XSS vector. Please use ports or web components instead.")'
: value;
}
Expand Down

0 comments on commit 06ce9cc

Please sign in to comment.