From d05a2628199ade2e22e2176b5d85d934fc19d588 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Tue, 11 Jul 2017 16:56:35 +0200 Subject: [PATCH] Auth: Protect User::setDomain() from empty strings --- library/Icinga/User.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/Icinga/User.php b/library/Icinga/User.php index 862d6c9de..e3046fb59 100644 --- a/library/Icinga/User.php +++ b/library/Icinga/User.php @@ -379,7 +379,11 @@ class User */ public function setDomain($domain) { - $this->domain = $domain; + $domain = trim($domain); + + if (strlen($domain)) { + $this->domain = $domain; + } return $this; }