From 0312ecf09dedbea19a7192ef153e3e0d8ea579a6 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 12 Oct 2022 10:30:47 -0700 Subject: [PATCH] Sets nullable attribute on validation Signed-off-by: snipe --- app/Http/Controllers/SettingsController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index 14d0904226..111eb1baed 100755 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -923,8 +923,8 @@ class SettingsController extends Controller $validator = Validator::make($setting->toArray(), [ 'ldap_username_field' => 'not_in:sAMAccountName', - 'ldap_auth_filter_query' => 'not_in:uid=samaccountname', - 'ldap_filter' => 'regex:"^[^(]"', + 'ldap_auth_filter_query' => 'not_in:uid=samaccountname|required_if:ldap_enabled,1', + 'ldap_filter' => 'nullable|regex:"^[^(]"|required_if:ldap_enabled,1', ], $messages);