Skip to content
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

validation rule password never match #1728

Closed
keulu-ing opened this issue Feb 16, 2019 · 3 comments
Closed

validation rule password never match #1728

keulu-ing opened this issue Feb 16, 2019 · 3 comments

Comments

@keulu-ing
Copy link

keulu-ing commented Feb 16, 2019

Describe the bug
The validation error is always triggered when use required_with[] check
The validation error is always triggered when use matches[] check

CodeIgniter 4 version
alpha-5

Affected module(s)
Form Validator

Reproduce the behavior
my rules :

protected $validationRules    = [
        'password'     => 'required|min_length[8]',
        // 'password_confirm' => 'required_with[password]|matches[password]'
        'password_confirm' => 'matches[password]'
    ];
curl -X POST \
  localhost/users \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'cache-control: no-cache' \
  -d 'password=toto&password_confirm=toto'

"password_confirm": "The password_confirm field is required when password is present."

remove the require_check[]

"password_confirm": "The password_confirm field does not match the password field."

my validations_rules are in my model. everything seems to work exept this one.

Context

  • OS: LMDE2
  • Web server Nginx
  • PHP version 7.1
@keulu-ing keulu-ing changed the title required_with[password] never match validation rule password never match Feb 16, 2019
@lonnieezell
Copy link
Member

What data is being passed in for validation?

@keulu-ing
Copy link
Author

keulu-ing commented Feb 17, 2019

curl -X POST \
  localhost/users \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'cache-control: no-cache' \
  -d 'password=toto&password_confirm=toto'

password=toto
password_confirm=toto

both exists in my $request->getPost()

@bangbangda
Copy link
Contributor

bangbangda commented Feb 18, 2019

required_with rule bug, fixing...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants