Skip to content
Snippets Groups Projects
Commit 79ebd0e6 authored by Stephan Großberndt's avatar Stephan Großberndt Committed by Stefan Bürk
Browse files

[BUGFIX] Avoid postgresql error previewing a fe_group-protected page

Avoid a postgresql error when previewing a page from the backend which
has an access protection by a fe_group due to PreviewSimulator faking
a fe_user with uid PHP_INT_MAX and sql failure to update the is_online
status of this fake user in PostgreSQL as column fe_users.uid is of type
integer and thus has max value of 2147483647 instead of PHP_INT_MAX.

Releases: main, 11.5, 10.4
Resolves: #97564
Change-Id: I16c866c368a9b3f5ac6bdfacf2c6660a7046df5a
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74471


Reviewed-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
parent 91829c49
Branches
Tags
No related merge requests found
......@@ -533,7 +533,9 @@ class FrontendUserAuthentication extends AbstractUserAuthentication
*/
public function updateOnlineTimestamp()
{
if (!is_array($this->user) || !($this->user['uid'] ?? 0)
if (!is_array($this->user)
|| !($this->user['uid'] ?? 0)
|| $this->user['uid'] === PHP_INT_MAX // Simulated preview user (flagged with PHP_INT_MAX uid)
|| ($this->user['is_online'] ?? 0) >= $GLOBALS['EXEC_TIME'] - 60) {
return;
}
......
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