#111661Workspace preview logout fails for URLs containing percent-encoded characters
Description
When the frontend is requested with ADMCMD_prev=LOGOUT, WorkspacePreview::getLogoutTemplateMessage() builds the “You logged out from Workspace preview mode” message with sprintf(), including the current URL in the link. The finished message is then passed through sprintf() a second time as the format string.
If the URL contains percent-encoded characters, PHP reads them as conversion specifiers in that second call. Every non-ASCII slug has such characters, e.g. %E3%81%8A (%E is a valid specifier). The request then fails with an uncaught ArgumentCountError and an HTTP 500 instead of showing the logout message.
The second sprintf() exists only to fill the %1$s marker of a custom $GLOBALS[‘TYPO3_CONF_VARS’][‘FE’][‘workspacePreviewLogoutTemplate’]. It doesn’t apply to the default message or to the “template not found” error message.
Steps to reproduce
1. Leave workspacePreviewLogoutTemplate empty (default).
2. Request a page with percent-encoded characters in its URL and the logout parameter, e.g. https://example.com/%E3%81%8A%E5%AE%A2/?ADMCMD_prev=LOGOUT.
Expected: the logout message with a link back to https://example.com/%E3%81%8A%E5%AE%A2/.
Actual: ArgumentCountError: 7 arguments are required, 2 given thrown in typo3/sysext/workspaces/Classes/Middleware/WorkspacePreview.php.
Reviews 1
History 01
-
Gerrit Code Review pushed patch set 1 for main to change 98199 status
NewUnder Review 11/29/26, 20:46