Skip to content
Snippets Groups Projects
Commit d91b1752 authored by Oliver Bartsch's avatar Oliver Bartsch
Browse files

[BUGFIX] Prevent PHP deprecation in getCookieName()

Resolves: #103182
Releases: main, 12.4
Change-Id: If16e37c638a07e3afbb59d665141cc2ade583f4d
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83083


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarOliver Bartsch <bo@cedev.de>
Tested-by: default avatarAndreas Kienast <a.fernandez@scripting-base.de>
Reviewed-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: default avatarAndreas Kienast <a.fernandez@scripting-base.de>
Tested-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
parent e94271f6
Branches
Tags
No related merge requests found
......@@ -1810,18 +1810,12 @@ class BackendUserAuthentication extends AbstractUserAuthentication
}
/**
* Getter for the cookie name
*
* @static
* @return string returns the configured cookie name
* Returns the configured cookie name
*/
public static function getCookieName()
public static function getCookieName(): string
{
$configuredCookieName = trim($GLOBALS['TYPO3_CONF_VARS']['BE']['cookieName']);
if (empty($configuredCookieName)) {
$configuredCookieName = 'be_typo_user';
}
return $configuredCookieName;
$configuredCookieName = trim((string)($GLOBALS['TYPO3_CONF_VARS']['BE']['cookieName'] ?? ''));
return $configuredCookieName !== '' ? $configuredCookieName : 'be_typo_user';
}
/**
......
......@@ -163,16 +163,11 @@ class FrontendUserAuthentication extends AbstractUserAuthentication
/**
* Returns the configured cookie name
*
* @return string
*/
public static function getCookieName()
public static function getCookieName(): string
{
$configuredCookieName = trim($GLOBALS['TYPO3_CONF_VARS']['FE']['cookieName']);
if (empty($configuredCookieName)) {
$configuredCookieName = 'fe_typo_user';
}
return $configuredCookieName;
$configuredCookieName = trim((string)($GLOBALS['TYPO3_CONF_VARS']['FE']['cookieName'] ?? ''));
return $configuredCookieName !== '' ? $configuredCookieName : 'fe_typo_user';
}
/**
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment