Skip to content

Commit a043fe6

Browse files
committed
🐛 fix form_validation not found in the valid_password() method
Signed-off-by: otengkwame <[email protected]>
1 parent 985a31b commit a043fe6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

CodeIgniter/Framework/libraries/Form_validation.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2123,49 +2123,49 @@ public function valid_password($password = '')
21232123

21242124
if (empty($password)) {
21252125

2126-
$this->form_validation->set_message('valid_password', 'The {field} field is required.');
2126+
$this->set_message('valid_password', 'The {field} field is required.');
21272127

21282128
return false;
21292129
}
21302130

21312131
if (preg_match_all($regex_lowercase, $password) < 1) {
21322132

2133-
$this->form_validation->set_message('valid_password', 'The {field} field must be at least one lowercase letter.');
2133+
$this->set_message('valid_password', 'The {field} field must be at least one lowercase letter.');
21342134

21352135
return false;
21362136
}
21372137

21382138
if (preg_match_all($regex_uppercase, $password) < 1) {
21392139

2140-
$this->form_validation->set_message('valid_password', 'The {field} field must be at least one uppercase letter.');
2140+
$this->set_message('valid_password', 'The {field} field must be at least one uppercase letter.');
21412141

21422142
return false;
21432143
}
21442144

21452145
if (preg_match_all($regex_number, $password) < 1) {
21462146

2147-
$this->form_validation->set_message('valid_password', 'The {field} field must have at least one number.');
2147+
$this->set_message('valid_password', 'The {field} field must have at least one number.');
21482148

21492149
return false;
21502150
}
21512151

21522152
if (preg_match_all($regex_special, $password) < 1) {
21532153

2154-
$this->form_validation->set_message('valid_password', 'The {field} field must have at least one special character.' . ' ' . htmlentities('!@#$%^&*()\-_=+{};:,<.>§~'));
2154+
$this->set_message('valid_password', 'The {field} field must have at least one special character.' . ' ' . htmlentities('!@#$%^&*()\-_=+{};:,<.>§~'));
21552155

21562156
return false;
21572157
}
21582158

21592159
if (strlen($password) < 5) {
21602160

2161-
$this->form_validation->set_message('valid_password', 'The {field} field must be at least 5 characters in length.');
2161+
$this->set_message('valid_password', 'The {field} field must be at least 5 characters in length.');
21622162

21632163
return false;
21642164
}
21652165

21662166
if (strlen($password) > 32) {
21672167

2168-
$this->form_validation->set_message('valid_password', 'The {field} field cannot exceed 32 characters in length.');
2168+
$this->set_message('valid_password', 'The {field} field cannot exceed 32 characters in length.');
21692169

21702170
return false;
21712171
}

0 commit comments

Comments
 (0)