mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Fixed CaptchaValidator
to pass correct hashKey
Fixed `yii\validators\CaptchaValidator` passed incorrect hashKey to JS validator when `captchaAction` begins with `/` Closes #10385
This commit is contained in:
@ -41,6 +41,7 @@ Yii Framework 2 Change Log
|
||||
- Bug #10142: Fixed `yii\validators\EmailValidator` to check the length of email properly (silverfire)
|
||||
- Bug #10278: Fixed `yii\helpers\BaseJson` support \SimpleXMLElement data (SilverFire, LAV45)
|
||||
- Bug #10302: Fixed JS function `yii.getQueryParams`, which parsed array variables incorrectly (servocoder, silverfire)
|
||||
- Bug #10385: Fixed `yii\validators\CaptchaValidator` passed incorrect hashKey to JS validator when `captchaAction` begins with `/` (silverfire)
|
||||
- Bug: Fixed generation of canonical URLs for `ViewAction` pages (samdark)
|
||||
- Bug: Fixed `mb_*` functions calls to use `UTF-8` or `Yii::$app->charset` (silverfire)
|
||||
- Enh #3506: Added `yii\validators\IpValidator` to perform validation of IP addresses and subnets (SilverFire, samdark)
|
||||
|
@ -91,7 +91,7 @@ class CaptchaValidator extends Validator
|
||||
$hash = $captcha->generateValidationHash($this->caseSensitive ? $code : strtolower($code));
|
||||
$options = [
|
||||
'hash' => $hash,
|
||||
'hashKey' => 'yiiCaptcha/' . $this->captchaAction,
|
||||
'hashKey' => 'yiiCaptcha/' . $captcha->getUniqueId(),
|
||||
'caseSensitive' => $this->caseSensitive,
|
||||
'message' => Yii::$app->getI18n()->format($this->message, [
|
||||
'attribute' => $object->getAttributeLabel($attribute),
|
||||
|
Reference in New Issue
Block a user