Skip to content
This repository was archived by the owner on Apr 1, 2019. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion classes/captcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,16 @@ public function invalid_count($new_count = NULL)
{
return $this->valid_count($new_count, TRUE);
}

/**
* Invalidate a captcha session, so prevent that same captcha_reponse can be used again
*
* @return void
*/
public static function invalidate()
{
Session::instance()->delete('captcha_response');
}

/**
* Resets the Captcha response counters and removes the count sessions.
Expand Down Expand Up @@ -431,7 +441,7 @@ public function image_render($html)
{
// Output html element
if ($html === TRUE)
return '<img src="'.url::site('captcha/'.Captcha::$config['group']).'" width="'.Captcha::$config['width'].'" height="'.Captcha::$config['height'].'" alt="Captcha" class="captcha" />';
return '<img src="'.url::site('captcha/'.Captcha::$config['group']).'?id='.uniqid().'" width="'.Captcha::$config['width'].'" height="'.Captcha::$config['height'].'" alt="Captcha" class="captcha" />';

// Send the correct HTTP header
Request::instance()->headers['Content-Type'] = 'image/'.$this->image_type;
Expand Down