From df35ecdf292d3e970b127a877b1707cbdc4f07f7 Mon Sep 17 00:00:00 2001 From: Jan K <52606324+cs-jako@users.noreply.github.com> Date: Thu, 27 Jun 2024 10:30:18 +0200 Subject: [PATCH] Fix for empty IMSC_USERNAME (#2) * Fix for empty IMSC_USERNAME * This should be strict --- src/Immoscout/ApiRequest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Immoscout/ApiRequest.php b/src/Immoscout/ApiRequest.php index 96d2d36..243a675 100644 --- a/src/Immoscout/ApiRequest.php +++ b/src/Immoscout/ApiRequest.php @@ -28,6 +28,9 @@ public function __construct(?array $auth = null, ?string $user = null) { $this->client = $this->getPreparedClient($auth); $this->user = $user ?? $_ENV['IMSC_USERNAME'] ?? 'me'; + if (trim($this->user) === '') { + $this->user = 'me'; + } } /**