|
@ -25,7 +25,7 @@ rules.push(require('./rules_inline/htmltag')); |
|
|
rules.push(require('./rules_inline/entity')); |
|
|
rules.push(require('./rules_inline/entity')); |
|
|
rules.push(require('./rules_inline/escape_html_char')); |
|
|
rules.push(require('./rules_inline/escape_html_char')); |
|
|
|
|
|
|
|
|
var BAD_PROTOCOLS = [ 'vbscript', 'javascript' ]; |
|
|
var BAD_PROTOCOLS = [ 'vbscript', 'javascript', 'file' ]; |
|
|
|
|
|
|
|
|
function validateLink(url) { |
|
|
function validateLink(url) { |
|
|
var str = ''; |
|
|
var str = ''; |
|
@ -36,7 +36,7 @@ function validateLink(url) { |
|
|
|
|
|
|
|
|
if (!str) { return false; } |
|
|
if (!str) { return false; } |
|
|
|
|
|
|
|
|
if (BAD_PROTOCOLS.indexOf(str.split(':')[0]) >= 0) { |
|
|
if (str.indexOf(':') >= 0 && BAD_PROTOCOLS.indexOf(str.split(':')[0]) >= 0) { |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
return true; |
|
|
return true; |
|
|