Below is the default code from Opencart 2.3.0.2 on github. Its found in approx 5 php files. Currently the password requirements is min 4 and max 20 characters. I want to make it 8 min, one uppercase, one lowercase, and a special character. It has to be similar format so that i can paste over the code.
https://github.com/opencart/opencart/blob/2.2.0.0/upload/catalog/controller/account/password.php
if ((utf8_strlen($this->request->post['password']) < 4) || (utf8_strlen($this->request->post['password']) > 20)) {
$this->error['password'] = $this->language->get('error_password');
Could this work or is there a better one?
if (!preg_match('^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=])(?=\S+$).{8,}$', $this->request->post['password'])) {
$this->error['password'] = $this->language->get('error_password');