Changeset 3031 for trunk/system/libraries/Captcha.php
- Timestamp:
- 07/10/2008 11:06:23 AM (5 months ago)
- Files:
-
- 1 modified
-
trunk/system/libraries/Captcha.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/libraries/Captcha.php
r3027 r3031 27 27 28 28 // The Captcha challenge answer, the text the user is supposed to enter 29 public static $ answer;29 public static $response; 30 30 31 31 /** … … 121 121 122 122 // Generate a new Captcha challenge 123 self::$ answer= (string) $this->driver->generate_challenge();123 self::$response = (string) $this->driver->generate_challenge(); 124 124 125 125 // Store the answer in a session 126 Session::instance()->set('captcha_ answer', self::$answer);126 Session::instance()->set('captcha_response', self::$response); 127 127 128 128 Log::add('debug', 'Captcha Library initialized'); … … 130 130 131 131 /** 132 * Validates a Captcha answer.132 * Validates a Captcha response. 133 133 * 134 * @param string captcha answer134 * @param string captcha response 135 135 * @return boolean 136 136 */ 137 public static function valid($ answer)137 public static function valid($response) 138 138 { 139 return (strtoupper($ answer) === strtoupper(Session::instance()->get('captcha_answer')));139 return (strtoupper($response) === strtoupper(Session::instance()->get('captcha_response'))); 140 140 } 141 141
