diff --git a/SECURITY.md b/SECURITY.md index 90b8c0044..2a5c9c1d1 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -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 diff --git a/app/Http/Requests/Portal/Profile.php b/app/Http/Requests/Portal/Profile.php index 0cc532d87..d5c7d3964 100644 --- a/app/Http/Requests/Portal/Profile.php +++ b/app/Http/Requests/Portal/Profile.php @@ -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, ]; }