Don't use v1 cached captchas for new threads. #1300
This commit is contained in:
parent
d7287b5185
commit
73c8054b64
@ -21,9 +21,11 @@ Captcha.cache =
|
||||
@captchas = captchas
|
||||
@count()
|
||||
|
||||
getOne: ->
|
||||
getOne: (isReply) ->
|
||||
@clear()
|
||||
if (captcha = @captchas.shift())
|
||||
i = @captchas.findIndex((x) -> isReply or !x.challenge?)
|
||||
if i >= 0
|
||||
captcha = @captchas.splice(i, 1)[0]
|
||||
$.set 'captchas', @captchas
|
||||
@count()
|
||||
captcha
|
||||
|
||||
@ -134,8 +134,8 @@ Captcha.v1 =
|
||||
delete @occupied
|
||||
@beforeSetup() if @nodes
|
||||
|
||||
getOne: ->
|
||||
if (captcha = Captcha.cache.getOne())
|
||||
getOne: (isReply) ->
|
||||
if (captcha = Captcha.cache.getOne isReply)
|
||||
captcha
|
||||
else
|
||||
challenge = @nodes.img.alt
|
||||
|
||||
@ -153,8 +153,8 @@ Captcha.v2 =
|
||||
$.rm node
|
||||
return
|
||||
|
||||
getOne: ->
|
||||
Captcha.cache.getOne()
|
||||
getOne: (isReply) ->
|
||||
Captcha.cache.getOne isReply
|
||||
|
||||
save: (pasted, token) ->
|
||||
Captcha.cache.save
|
||||
|
||||
@ -621,7 +621,7 @@ QR =
|
||||
err or= 'Original comment required.'
|
||||
|
||||
if QR.captcha.isEnabled and !err
|
||||
captcha = QR.captcha.getOne()
|
||||
captcha = QR.captcha.getOne(!!threadID)
|
||||
unless captcha
|
||||
err = 'No valid captcha.'
|
||||
QR.captcha.setup(!QR.cooldown.auto or d.activeElement is QR.nodes.status)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user