. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Http\RequestHandlers; use Fisharebest\Webtrees\Validator; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; /** * Search for genealogy data */ class SearchAdvancedAction implements RequestHandlerInterface { /** * @param ServerRequestInterface $request * * @return ResponseInterface */ public function handle(ServerRequestInterface $request): ResponseInterface { $tree = Validator::attributes($request)->tree(); $fields = Validator::parsedBody($request)->array('fields'); $modifiers = Validator::parsedBody($request)->array('modifiers'); $other_field = Validator::parsedBody($request)->string('other_field'); if ($other_field !== '') { $fields[$other_field] = ''; } return redirect(route(SearchAdvancedPage::class, [ 'fields' => $fields, 'modifiers' => $modifiers, 'tree' => $tree->name(), ])); } }