Merge pull request #844 from chjj/data_link_fix
added data link fix to prevent xss
This commit is contained in:
commit
8f9d0b72f5
@ -875,7 +875,7 @@ Renderer.prototype.link = function(href, title, text) {
|
||||
} catch (e) {
|
||||
return '';
|
||||
}
|
||||
if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0) {
|
||||
if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
<p></p>
|
||||
<p></p>
|
||||
<p></p>
|
||||
<p></p>
|
||||
<p></p>
|
@ -4,4 +4,6 @@
|
||||
|
||||
[URL](javascript:alert(1))
|
||||
|
||||
[URL](javascript:document;alert(1))
|
||||
[URL](javascript:document;alert(1))
|
||||
|
||||
[URL](data:text/html;base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4K)
|
Loading…
x
Reference in New Issue
Block a user