# HG changeset patch # User Dan # Date 1201923117 18000 # Node ID e133d321fce410747b35800e3d06dc4598381b70 # Parent 43b908c9b2e262b32e022a10382abf4514592901 Made all captcha fields case-insensitive (thanks pkeating) diff -r 43b908c9b2e2 -r e133d321fce4 includes/comment.php --- a/includes/comment.php Thu Jan 31 22:28:40 2008 -0500 +++ b/includes/comment.php Fri Feb 01 22:31:57 2008 -0500 @@ -268,7 +268,7 @@ if ( getConfig('comments_need_login') == '1' && !$session->user_logged_in ) { $real_code = $session->get_captcha($data['captcha_id']); - if ( $real_code != $data['captcha_code'] ) + if ( strtolower($real_code) != strtolower($data['captcha_code']) ) $errors[] = 'The confirmation code you entered was incorrect.'; $session->kill_captcha(); } diff -r 43b908c9b2e2 -r e133d321fce4 includes/pageutils.php --- a/includes/pageutils.php Thu Jan 31 22:28:40 2008 -0500 +++ b/includes/pageutils.php Fri Feb 01 22:31:57 2008 -0500 @@ -895,7 +895,7 @@ { if(!$captcha_code || !$captcha_id) _die('BUG: PageUtils::addcomment: no CAPTCHA data passed to method'); $result = $session->get_captcha($captcha_id); - if($captcha_code != $result) _die('The confirmation code you entered was incorrect.'); + if(strtolower($captcha_code) != strtolower($result)) _die('The confirmation code you entered was incorrect.'); } $text = RenderMan::preprocess_text($text); $name = $session->user_logged_in ? RenderMan::preprocess_text($session->username) : RenderMan::preprocess_text($name); diff -r 43b908c9b2e2 -r e133d321fce4 plugins/SpecialUserFuncs.php --- a/plugins/SpecialUserFuncs.php Thu Jan 31 22:28:40 2008 -0500 +++ b/plugins/SpecialUserFuncs.php Fri Feb 01 22:31:57 2008 -0500 @@ -361,7 +361,7 @@ $captcharesult = $session->get_captcha($_POST['captchahash']); $session->kill_captcha(); - if($captcharesult != $_POST['captchacode']) + if(strtolower($captcharesult) != strtolower($_POST['captchacode'])) { $s = 'The confirmation code you entered was incorrect.'; }