Merge branch 'master' of https://github.com/brkcvn/akaunting into code-clean

This commit is contained in:
Burak Civan 2022-08-24 09:29:14 +03:00
commit aba0bc9356
2 changed files with 9 additions and 3 deletions

View File

@ -11,7 +11,8 @@ Feel free to report security issues based on the following chart.
| 1.2.x | :x: |
| 1.3.x | :x: |
| 2.0.x | :x: |
| 2.1.x | :white_check_mark: |
| 2.1.x | :x: |
| 3.0.x | :white_check_mark: |
## Reporting a Vulnerability

View File

@ -34,11 +34,16 @@ class Profile extends FormRequest
. ',deleted_at,NULL';
}
$change_password = $this->request->get('change_password') == true || $this->request->get('change_password') != null;
$current_password = $change_password ? '|current_password' : '';
$password = $change_password ? '|confirmed' : '';
return [
'name' => 'required|string',
'email' => $email,
'current_password' => 'required_if:change_password,true|current_password',
'password' => 'required_if:change_password,true|confirmed',
'current_password' => 'required_if:change_password,true' . $current_password,
'password' => 'required_if:change_password,true' . $password,
'picture' => $picture,
];
}