Skip to content

Commit

Permalink
#64 fixed 'Search Contacts' combination input
Browse files Browse the repository at this point in the history
  • Loading branch information
MManthey committed Oct 24, 2024
1 parent ff33bba commit 4f93909
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions includes/admin/settings-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -662,11 +662,23 @@ function rrze_faudir_search_person_ajax() {
$familyName = isset($_POST['family_name']) ? sanitize_text_field($_POST['family_name']) : '';
$email = isset($_POST['email']) ? sanitize_email($_POST['email']) : '';

$queryParts = [];

if (!empty($personId)) {
$queryParts[] = 'identifier=' . urlencode($personId);
}
if (!empty($givenName)) {
$queryParts[] = 'givenName=' . urlencode($givenName);
}
if (!empty($familyName)) {
$queryParts[] = 'familyName=' . urlencode($familyName);
}
if (!empty($email)) {
$queryParts[] = 'email=' . urlencode($email);
}

$params = [
'givenName' => $givenName,
'familyName' => $familyName,
'identifier' => $personId,
'email' => $email,
'lq' => implode('&', $queryParts)
];

$response = fetch_fau_persons_atributes(60, 0, $params);
Expand Down

0 comments on commit 4f93909

Please sign in to comment.