From f1e580e1e188d3245cc335821092751e51b858ea Mon Sep 17 00:00:00 2001 From: ccd0 Date: Wed, 31 Jan 2018 20:28:51 -0800 Subject: [PATCH] Captcha bypass cookie does not work for starting threads. Updating to treat this case correctly. --- src/Posting/Captcha.cache.coffee | 2 +- src/Posting/QR.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Posting/Captcha.cache.coffee b/src/Posting/Captcha.cache.coffee index bbd20657f..2c0ea4b7b 100644 --- a/src/Posting/Captcha.cache.coffee +++ b/src/Posting/Captcha.cache.coffee @@ -10,7 +10,7 @@ Captcha.cache = needed: -> not ( - /\b_ct=/.test(d.cookie) or @captchas.length or QR.req + (/\b_ct=/.test(d.cookie) and QR.posts[0].thread isnt 'new') or @captchas.length or QR.req ) and ( QR.posts.length > 1 or Conf['Auto-load captcha'] or QR.posts[0].com or QR.posts[0].file ) diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index 0fc048fc9..4167ef9a1 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -664,7 +664,7 @@ QR = if g.BOARD.ID is 'r9k' and !post.com?.match(/[a-z-]/i) err or= 'Original comment required.' - if QR.captcha.isEnabled and !/\b_ct=/.test(d.cookie) and !err + if QR.captcha.isEnabled and !(/\b_ct=/.test(d.cookie) and threadID) and !err captcha = QR.captcha.getOne(!!threadID) unless captcha err = 'No valid captcha.'