diff --git a/framework/yii/web/CaptchaAction.php b/framework/yii/web/CaptchaAction.php index 98599d9..fef44fd 100644 --- a/framework/yii/web/CaptchaAction.php +++ b/framework/yii/web/CaptchaAction.php @@ -189,15 +189,15 @@ class CaptchaAction extends Action */ protected function generateVerifyCode() { + if ($this->minLength > $this->maxLength) { + $this->maxLength = $this->minLength; + } if ($this->minLength < 3) { $this->minLength = 3; } if ($this->maxLength > 20) { $this->maxLength = 20; } - if ($this->minLength > $this->maxLength) { - $this->maxLength = $this->minLength; - } $length = mt_rand($this->minLength, $this->maxLength); $letters = 'bcdfghjklmnpqrstvwxyz';