Closed (fixed)
Project:
Text CAPTCHA
Version:
7.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Jun 2013 at 16:39 UTC
Updated:
23 Sep 2013 at 19:01 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
bryanhirsch commentedI'm working on a proposed solution here:
https://github.com/bryanhirsch/textcaptcha
I'll post the patch when the solution is fully baked and ready for review. In the meanwhile, anyone who wants to help should feel free to ping me or fork this on github.
Comment #2
tknospdr commentedI have just installed textcaptcha and notice a similar issue. If I refresh a page that has the captcha on it 2 to 3 times per 10 refreshes I get no question, just the answer box.
You can see it in action by refreshing this page: http://www.floridapets.org/user/register
Comment #3
bryanhirsch commentedPlease see attached patch.
This is also on github here:
https://github.com/bryanhirsch/textcaptcha
The patch is the difference between these two commits:
99477769b52a85c27621150e5b1f3e20a5731c72 <-- Tip of 7.x-1.x branch
a6c40f4a275276ceb2bc4b90ca237ad17bd648c2 <-- My most recent commit
Comment #4
Anonymous (not verified) commentedThanks, @bryanhirsch for this patch. While I agree that it's annoying to depend on a service that might go down, I think we should seek some input from Rob (feeder of textcaptcha) about how he feels about this approach. I couldn't find a hard-and-fast TOS for textcaptcha, but I think his input would be valuable. I'll reach out to him and see what he thinks.
Comment #5
vali hutchison commentedI've been testing the module today using the a6c40f4a275276ceb2bc4b90ca237ad17bd648c2 commit mentioned in https://drupal.org/node/2013859#comment-7508239
It works well, apart from about every 10 times I get the error "Sorry. Something went wrong. This CAPTCHA won't work. Please reload your page."
When this happens then the
if ($cache = cache_get('textcaptcha_challenges'))on line 156 is run, but the value of $challenge is empty.When i did print_r($cache); then my cache had some empty elements in the $cache->data array - so in the case of the error then the randomly selected array element is one of the empty ones.
To remedy this I have changed line 157 from:
$challenges =$cache->data;to
$challenges = array_filter($cache->data);which strips out the empty elements first before choosing a random one.
Comment #6
bryanhirsch commented@kevee, sounds good. Thanks for checking.
@SlackerD, good catch. Thanks! Included array_filter() in cache_set and cache_get in attached reroll of patch.
Comment #7
theneonlobster commentedThe patch in #6 didn't apply to the tip of 7.x-1.x; it was generated for the 7.x-1.2 release. I've generated a new patch for the same release, and this one includes an option to disable fetching questions on cron.
Comment #8
bryanhirsch commented@theneonlobster, awesome. Thanks.
Comment #9
Anonymous (not verified) commentedI just heard from the maintainer of textcaptcha that he's fine with this approach. I'm a bit busy right now, but if someone can change this to reviewed and tested I'll commit it.
Also, since it's always nice to have more committers, if Bryan would like to help maintain this module I'd appreciate it.
Comment #10
bryanhirsch commented@kevee, sure. With these changes committed my cart is officially hitched to the textcaptcha wagon. Happy to help maintain it.
Comment #11
theneonlobster commentedThe attached patch stores and manages challenge questions and answers locally in textcaptcha tables rather than the cache table. It also includes a drush command to fetch challenges, and a flag to disable fetching on cron.
Comment #12
theneonlobster commentedThe last patch included an element from a different issue. The attached patch resolves that.
Comment #13
theneonlobster commentedMissed a typo. One last patch.
Comment #14
bryanhirsch commented