ObjectsController: fix 8.1 glitch for JSON format

This commit is contained in:
Thomas Gelf 2022-07-15 09:55:02 +02:00
parent f24f8eb287
commit fe3d5c7076
2 changed files with 2 additions and 2 deletions

View File

@ -89,7 +89,7 @@ class IcingaObjectsHandler extends RequestHandler
$resolved = (bool) $params->get('resolved', false); $resolved = (bool) $params->get('resolved', false);
$withNull = ! $params->shift('withNull'); $withNull = ! $params->shift('withNull');
$properties = $params->shift('properties'); $properties = $params->shift('properties');
if (strlen($properties)) { if ($properties !== null && strlen($properties)) {
$properties = preg_split('/\s*,\s*/', $properties, -1, PREG_SPLIT_NO_EMPTY); $properties = preg_split('/\s*,\s*/', $properties, -1, PREG_SPLIT_NO_EMPTY);
} else { } else {
$properties = null; $properties = null;

View File

@ -85,7 +85,7 @@ abstract class ObjectsController extends ActionController
$table->filterObjectType('apply'); $table->filterObjectType('apply');
} }
$search = $this->params->get('q'); $search = $this->params->get('q');
if (\strlen($search) > 0) { if ($search !== null && \strlen($search) > 0) {
$table->search($search); $table->search($search);
} }