Skip to content

Commit

Permalink
fix type error if string is used for uid search
Browse files Browse the repository at this point in the history
  • Loading branch information
mrothauer committed Jan 15, 2025
1 parent 2328f21 commit b7e4ae1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions plugins/Admin/src/Controller/AdminAppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ protected function generateSearchConditions($searchFieldKey)
]]);
if ($key) {
$searchOption = $this->searchOptions[
$queryParams[
'key-' . $searchFieldKey
]
$queryParams['key-' . $searchFieldKey]
];
$searchType = $searchOption['searchType'];
$negate = $searchOption['negate'] ?? false;
Expand All @@ -127,7 +125,11 @@ protected function generateSearchConditions($searchFieldKey)
}
switch ($searchType) {
case 'equal':
$this->conditions[$queryParams['key-' . $searchFieldKey]] = $queryParams['val-' . $searchFieldKey];
$condition = $queryParams['val-' . $searchFieldKey];
if (strpos($queryParams['key-' . $searchFieldKey], '.uid') !== false) {
$condition = false; // only integers allowed
}
$this->conditions[$queryParams['key-' . $searchFieldKey]] = $condition;
break;
case 'search':
$condition = $queryParams['key-' . $searchFieldKey] . " LIKE '%" . $queryParams['val-' . $searchFieldKey] . "%'";
Expand Down

0 comments on commit b7e4ae1

Please sign in to comment.