diff --git a/4chan_x.user.js b/4chan_x.user.js index 3b9f3295e..e4b02eda5 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2404,6 +2404,11 @@ QR.captcha.count(captchas.length); if (!response) { err = 'No valid captcha.'; + } else { + response = response.trim(); + if (!/\s/.test(response)) { + response = "" + response + " " + response; + } } } if (err) { @@ -2435,7 +2440,7 @@ mode: 'regist', pwd: (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : $('input[name=pwd]').value, recaptcha_challenge_field: challenge, - recaptcha_response_field: response.replace(/^\s+/, 'a ').replace(/\s+$/, ' a') + recaptcha_response_field: response }; callbacks = { onload: function() { diff --git a/changelog b/changelog index 43ad1d398..f3ded16ca 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,6 @@ master +- Mayhem + One-word-captcha: you don't need to input an extra space anymore, the true word will be duplicated. 2.34.7 - Mayhem diff --git a/script.coffee b/script.coffee index 32d38b95f..b392e3e5e 100644 --- a/script.coffee +++ b/script.coffee @@ -1863,6 +1863,11 @@ QR = QR.captcha.count captchas.length unless response err = 'No valid captcha.' + else + response = response.trim() + # one-word-captcha: + # If there's only one word, duplicate it. + response = "#{response} #{response}" unless /\s/.test response if err # stop auto-posting @@ -1896,7 +1901,7 @@ QR = mode: 'regist' pwd: if m = d.cookie.match(/4chan_pass=([^;]+)/) then decodeURIComponent m[1] else $('input[name=pwd]').value recaptcha_challenge_field: challenge - recaptcha_response_field: response.replace(/^\s+/, 'a ').replace /\s+$/, ' a' + recaptcha_response_field: response callbacks = onload: ->