From 3e23d567adcc0990e71f1aeb88161db9774b21fd Mon Sep 17 00:00:00 2001 From: Mayhem Date: Fri, 13 Jun 2014 01:36:19 +0200 Subject: [PATCH] Fix #1675. --- CHANGELOG.md | 2 ++ src/Posting/QR.captcha.coffee | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2274cface..bb6c5657f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +- The QR won't duplicate single-word captchas anymore if you've input numbers only (like a street address). + ### 3.20.13 - *2014-05-09* - [Security fix](https://github.com/MayhemYDG/4chan-x/issues/1634). diff --git a/src/Posting/QR.captcha.coffee b/src/Posting/QR.captcha.coffee index 8ecd95300..29d6e5822 100644 --- a/src/Posting/QR.captcha.coffee +++ b/src/Posting/QR.captcha.coffee @@ -61,9 +61,10 @@ QR.captcha = getOne: -> challenge = @nodes.img.alt response = @nodes.input.value.trim() - if response and !/\s/.test response + if response and !/\s|^\d+$/.test response # one-word-captcha: # If there's only one word, duplicate it. + # If it's a number (street address), don't duplicate it. response = "#{response} #{response}" {challenge, response} load: ->