-
-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for assigning validation data to strong_password method #222
Conversation
]); | ||
|
||
$result = $this->validation->withRequest($request)->run(); | ||
$this->assertTrue($result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this return false
now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, in this test I'm using strong_password[]
, so validation class grabs data from request and passes it to this rule (as a $data
parameter).
Hi, i tested in my enviromento and workds, but erorr message when passord is not strong is: i'think that "strong_pasword" rule should be like this:
$data variable is always filled. |
@nicojmb if you use a rule I couldn't get the error with |
This PR makes it possible to take parameters from the validation data array or just like before when this parameter is not available from request.
I made changes that will work in both cases. When using
strong_password
everything is working as before but when usingstrong_password[]
we will use data provided by the validation class.This will work even if in the future CodeIgniter will pass validation data to the rules without a need of using a special syntax
[]
.This approach doesn't break any compatibility for people who use
strong_password
right now, so it can be safely used without the need for changes in the developer's code.