Made all captcha fields case-insensitive (thanks pkeating)
authorDan
Fri, 01 Feb 2008 22:31:57 -0500
changeset 283 e133d321fce4
parent 282 43b908c9b2e2
child 284 d823e49e2e4e
Made all captcha fields case-insensitive (thanks pkeating)
includes/comment.php
includes/pageutils.php
plugins/SpecialUserFuncs.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();
         }
--- 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);
--- 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.';
     }