Skip to content

Commit

Permalink
[BUGFIX] Cast IP lock settings to int
Browse files Browse the repository at this point in the history
Avoid exceptions by casting the values to integers.

Resolves: #100916
Releases: main, 12.4, 11.5
Change-Id: Icb1eeef44b11f3134bec2b5cb036049c8cfbd620
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/79124
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
  • Loading branch information
georgringer committed May 31, 2023
1 parent 494a957 commit 5c1f968
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions typo3/sysext/core/Classes/Session/UserSessionManager.php
Expand Up @@ -360,8 +360,8 @@ public static function create(string $loginType, int $sessionLifetime = null, Se
$sessionManager = $sessionManager ?? GeneralUtility::makeInstance(SessionManager::class);
$ipLocker = $ipLocker ?? GeneralUtility::makeInstance(
IpLocker::class,
$GLOBALS['TYPO3_CONF_VARS'][$loginType]['lockIP'],
$GLOBALS['TYPO3_CONF_VARS'][$loginType]['lockIPv6']
(int)($GLOBALS['TYPO3_CONF_VARS'][$loginType]['lockIP'] ?? 0),
(int)($GLOBALS['TYPO3_CONF_VARS'][$loginType]['lockIPv6'] ?? 0)
);
$lifetime = (int)($GLOBALS['TYPO3_CONF_VARS'][$loginType]['lifetime'] ?? 0);
$sessionLifetime = $sessionLifetime ?? (int)$GLOBALS['TYPO3_CONF_VARS'][$loginType]['sessionTimeout'];
Expand Down

0 comments on commit 5c1f968

Please sign in to comment.