Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
0c1477c6
Commit
0c1477c6
authored
Oct 23, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #1050: renamed CaptchaValidator::getCaptchaAction() to createCaptchaAction().
parent
6c6dd011
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
CaptchaValidator.php
framework/yii/captcha/CaptchaValidator.php
+5
-7
No files found.
framework/yii/captcha/CaptchaValidator.php
View file @
0c1477c6
...
...
@@ -18,8 +18,6 @@ use yii\validators\Validator;
*
* CaptchaValidator should be used together with [[CaptchaAction]].
*
* @property \yii\captcha\CaptchaAction $captchaAction The action object. This property is read-only.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
...
...
@@ -71,16 +69,16 @@ class CaptchaValidator extends Validator
*/
public
function
validateValue
(
$value
)
{
$captcha
=
$this
->
get
CaptchaAction
();
$captcha
=
$this
->
create
CaptchaAction
();
return
!
is_array
(
$value
)
&&
$captcha
->
validate
(
$value
,
$this
->
caseSensitive
);
}
/**
* Returns the CAPTCHA action object.
* @throws InvalidConfigException
* Creates the CAPTCHA action object from the route specified by [[captchaAction]].
* @return \yii\captcha\CaptchaAction the action object
* @throws InvalidConfigException
*/
public
function
get
CaptchaAction
()
public
function
create
CaptchaAction
()
{
$ca
=
Yii
::
$app
->
createController
(
$this
->
captchaAction
);
if
(
$ca
!==
false
)
{
...
...
@@ -104,7 +102,7 @@ class CaptchaValidator extends Validator
*/
public
function
clientValidateAttribute
(
$object
,
$attribute
,
$view
)
{
$captcha
=
$this
->
get
CaptchaAction
();
$captcha
=
$this
->
create
CaptchaAction
();
$code
=
$captcha
->
getVerifyCode
(
false
);
$hash
=
$captcha
->
generateValidationHash
(
$this
->
caseSensitive
?
$code
:
strtolower
(
$code
));
$options
=
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment