--- a/includes/sessions.php Fri Dec 11 17:11:47 2009 -0500
+++ b/includes/sessions.php Sat Dec 12 15:44:36 2009 -0500
@@ -3488,10 +3488,11 @@
/**
* For the given code ID, returns the correct CAPTCHA code, or false on failure
* @param string $hash The unique ID assigned to the code
+ * @param bool If true, the code is NOT deleted from the database. Use with caution!
* @return string The correct confirmation code
*/
- function get_captcha($hash)
+ function get_captcha($hash, $nodelete = false)
{
global $db, $session, $paths, $template, $plugins; // Common objects
@@ -3517,7 +3518,10 @@
list($code_id, $code) = $db->fetchrow_num();
$db->free_result();
- $this->sql('DELETE FROM ' . table_prefix . "captcha WHERE code_id = $code_id;");
+
+ // delete it
+ if ( !$nodelete )
+ $this->sql('DELETE FROM ' . table_prefix . "captcha WHERE code_id = $code_id;");
return $code;
}