check for more parameters doSearch()

This commit is contained in:
Uwe Steinmann 2019-02-15 08:31:47 +01:00
parent 9729d211eb
commit bcefbca382

View File

@ -1214,10 +1214,16 @@ function doSearch($request, $response) { /* {{{ */
$params = $request->getQueryParams(); $params = $request->getQueryParams();
$querystr = $params['query']; $querystr = $params['query'];
$mode = $params['mode']; $mode = isset($params['mode']) ? $params['mode'] : '';
if(!$limit = $params['limit']) if(!isset($params['limit']) || !$limit = $params['limit'])
$limit = 5; $limit = 5;
$resArr = $dms->search($querystr); if(!isset($params['offset']) || !$offset = $params['offset'])
$offset = 0;
if(!isset($params['searchin']) || !$searchin = explode(",",$params['searchin']))
$searchin = array();
if(!isset($params['objects']) || !$objects = $params['objects'])
$objects = 0x3;
$resArr = $dms->search($querystr, $limit, $offset, 'AND', $searchin, null, null, array(), array(), array(), array(), array(), array(), array(), $objects);
if($resArr === false) { if($resArr === false) {
return $response->withJson(array(), 200); return $response->withJson(array(), 200);
} }