From 7d7e1366a6f19c25981dbf535e99303ddc056326 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 1 Feb 2022 07:14:51 +0100 Subject: [PATCH] Catch empty string. --- app/Api/V1/Controllers/Search/AccountController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Api/V1/Controllers/Search/AccountController.php b/app/Api/V1/Controllers/Search/AccountController.php index bc7adc0965..20fea66f3d 100644 --- a/app/Api/V1/Controllers/Search/AccountController.php +++ b/app/Api/V1/Controllers/Search/AccountController.php @@ -70,8 +70,8 @@ class AccountController extends Controller { Log::debug('Now in account search()'); $manager = $this->getManager(); - $query = $request->get('query'); - $field = $request->get('field'); + $query = trim((string)$request->get('query')); + $field = trim((string)$request->get('field')); $type = $request->get('type') ?? 'all'; if ('' === $query || !in_array($field, $this->validFields, true)) { return response(null, 422);