From 01a80c2da8e120069cd2be404400616f2d3f416a Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 27 Oct 2022 11:53:13 +0200 Subject: [PATCH] SelfServiceController: check for null values fixes #2614 --- application/controllers/SelfServiceController.php | 2 +- doc/82-Changelog.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/application/controllers/SelfServiceController.php b/application/controllers/SelfServiceController.php index d6ac80f3..0b3b642f 100644 --- a/application/controllers/SelfServiceController.php +++ b/application/controllers/SelfServiceController.php @@ -275,7 +275,7 @@ class SelfServiceController extends ActionController // PluginsUrl => framework_plugins_url ]; $username = $settings->get('self-service/icinga_service_user'); - if (strlen($username)) { + if ($username !== null && strlen($username) > 0) { $params['icinga_service_user'] = $username; } diff --git a/doc/82-Changelog.md b/doc/82-Changelog.md index a6015798..d767b4c1 100644 --- a/doc/82-Changelog.md +++ b/doc/82-Changelog.md @@ -21,6 +21,9 @@ v1.10.2 (unreleased) * FEATURE: more details shown in error messages related to invalid characters (#2646) * FIX: snapshots for Baskets containing Baskets failed since v1.10 (#2644) +### REST API +* FIX: Self Service API returned invalid JSON on PHP 8.1 (#2614) + ### Internals * FIX: issue with empty activity log, deprecate outdated method (#2630)