From ad3b93414aa70ab4270b42c00965e315d622404b Mon Sep 17 00:00:00 2001 From: Rico Sonntag Date: Thu, 26 Feb 2026 14:01:37 +0000 Subject: [PATCH] [BUGFIX] Fix undefined array key warning for REMOTE_USER in init() When no Shibboleth session is active, $_SERVER['REMOTE_USER'] is not set, causing a PHP Warning on every backend request. Use the null coalescing operator to default to null, which is already supported by the ?string property type and handled by all callers via empty() checks. Fixes #12 --- Classes/Typo3/Service/ShibbolethAuthenticationService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Typo3/Service/ShibbolethAuthenticationService.php b/Classes/Typo3/Service/ShibbolethAuthenticationService.php index 4d8ccf9..7619d0a 100644 --- a/Classes/Typo3/Service/ShibbolethAuthenticationService.php +++ b/Classes/Typo3/Service/ShibbolethAuthenticationService.php @@ -50,7 +50,7 @@ public function init(): bool if (empty($this->extensionConfiguration['displayName'])) { $this->extensionConfiguration['displayName'] = 'displayName'; } - $this->remoteUser = $_SERVER[$this->extensionConfiguration['remoteUser']]; + $this->remoteUser = $_SERVER[$this->extensionConfiguration['remoteUser']] ?? null; return parent::init(); }