test sauce link protocols against whitelist
This commit is contained in:
parent
e8fc907b10
commit
55d25b721f
@ -39,13 +39,13 @@ Sauce =
|
|||||||
else
|
else
|
||||||
type
|
type
|
||||||
ext = post.file.URL.match(/\.([^\.]*)$/)?[1] or ''
|
ext = post.file.URL.match(/\.([^\.]*)$/)?[1] or ''
|
||||||
if (!parts['boards'] or post.board.ID in parts['boards'].split ',') and (!parts['types'] or ext in parts['types'].split ',')
|
return null unless !parts['boards'] or post.board.ID in parts['boards'].split ','
|
||||||
a = Sauce.link.cloneNode true
|
return null unless !parts['types'] or ext in parts['types'].split ','
|
||||||
a.href = parts['url']
|
a = Sauce.link.cloneNode true
|
||||||
a.textContent = parts['text']
|
a.href = parts['url']
|
||||||
a
|
a.textContent = parts['text']
|
||||||
else
|
return null unless /^https?:$/.test a.protocol
|
||||||
null
|
a
|
||||||
node: ->
|
node: ->
|
||||||
return if @isClone or !@file
|
return if @isClone or !@file
|
||||||
nodes = []
|
nodes = []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user