|
|
@@ -420,6 +420,12 @@ class Zend_Captcha_Image extends Zend_Captcha_Word
|
|
|
public function generate()
|
|
|
{
|
|
|
$id = parent::generate();
|
|
|
+ $tries = 5;
|
|
|
+ // If there's already such file, try creating a new ID
|
|
|
+ while($tries-- && file_exists($this->getImgDir() . $id . $this->getSuffix())) {
|
|
|
+ $id = $this->_generateRandomId();
|
|
|
+ $this->_setId($id);
|
|
|
+ }
|
|
|
$this->_generateImage($id, $this->getWord());
|
|
|
|
|
|
if (mt_rand(1, $this->getGcFreq()) == 1) {
|