Closed (fixed)
Project:
CAPTCHA
Version:
5.x-2.2
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 May 2007 at 04:14 UTC
Updated:
5 Sep 2007 at 08:01 UTC
I had to comment out this line for me to not get a fatal error:
if($_SESSION['captcha'][$seed]['success'] === TRUE)
Not sure if it is working now or not.
[Thu May 10 00:11:17 2007] [error] [client 64.230.47.73] PHP Fatal error: Cannot use string offset as an array in /home/drupal/modules/captcha/captcha.module on line 166
I just upgraded this to the latest version since someone was having trouble with the math queries on my comments.
Comments
Comment #1
VDG commentedTry this patch.
Comment #2
mgiffordI just reverted to the old version of captcha - buggy as it may be.
site got the wsod earlier today due to:
[Thu May 10 12:23:49 2007] [error] [client 64.230.47.73] PHP Fatal error: Unsupported operand types in /home/dm_50/sites/all/modules/captcha/captcha.module on line 194, referer: http://openconcept.ca/
Comment #3
VDG commentedSteps to reproduce? Did you install the form-store module?
Comment #4
BradM commentedpatch didn't work for me, all it did was give me a different error message now.
Fatal error: Unsupported operand types in /path/to/modules/captcha/captcha.module on line 197
Line 197:
$form['#validate'] += array('captcha_validate' => array());
Comment #5
mgiffordI had installed the form_store module. Just upgraded it to the latest version, tried it again and it seems to be working now (which is great).
Mike
Comment #6
imp_squared commentedI try the patch above.. but still get "Cannot use string offset as an array" resulting from these lines.
200 $_SESSION['captcha'][$seed]['success'] = FALSE;
201 $_SESSION['captcha'][$seed]['form_id'] = $form_id;
202 $_SESSION['captcha'][$seed]['form'] = $result['form'];
203 $_SESSION['captcha'][$seed]['new_value'] = $result['value'];
204 $_SESSION['captcha'][$seed]['preprocess'] = isset($result['preprocess'])? $result['preprocess'] : FALSE;
205 $_SESSION['captcha'][$seed]['module'] = $challenge[0];
206 $_SESSION['captcha'][$seed]['type'] = $challenge[1];
there are more of these type of lines in the number lines below these ones.
I'm using the following:
- Drupal v5.1
- Form Store & Form Collect v5.x-1.0
- Captcha v5.x-2.1
also applied patch "captcha.inc__1.patch" from this post: http://drupal.org/node/143778#comment-247398
Thanks
Comment #7
mfer commentedThis seems to stem from the issue that $seed is grabbed from the token in the form and for anonymous users there is no token in the comment form. did a print_r($form) and found no token for the picking. All the errors (except the +=) seem to come from that.
This is a serious issue that needs a litle fixing.
Comment #8
mgiffordAre you using the latest version of form_store? Any page with a newsletter wasn't working before I added the latest version of the form store module and added the simplenews block to the list of forms.
Comment #9
mfer commentedMy issue is with anonymous comments. If you do a print_r($form) you'll find that anonymous users don't have a token to be read in and that's what's creating a bunch of the problems, i think.
Comment #10
mrgoltra commentedanother option is reCaptcha module which was released yesterday.
Comment #11
mrgoltra commentedsorry I posted in the wrong area. how can I delete
Comment #12
mgiffordmrgoltra, Unfortunately you can't delete or edit posts.
mefer, I don't know enough about the token that is supposed to be passed to know if this would have an effect or not. I just know it works now and didn't previously.
Comment #13
stella commentedsubscribing
Comment #14
stella commentedFYI, marked #145904 as a duplicate of this issue
Comment #15
Gábor Mayer commentedFatal error: Cannot use string offset as an array in /home/www/drupal/modules/captcha/captcha.module on line 169
Comment #16
slavikt commentedSo...
Is there any way to fix this problem?
Comment #17
mfer commentedwundo says there is a fix on his dev machine at home.... just hasn't posted it yet.
Comment #18
mariuss commentedHaving the exact same issue. And it is sort of random. It will happen from certain browsers only.
Comment #19
HorsePunchKid commentedSubscribing; same problem as #15 reports.
Comment #20
robloachI believe this issue was taken care of.