Ensure that the request ID is fully logged in SessionAccessLogListener
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 14 Dec 2020 16:19:00 +0000 (17:19 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 15 Dec 2020 10:44:24 +0000 (11:44 +0100)
wcfsetup/install/files/lib/system/event/listener/SessionAccessLogListener.class.php

index 948862aee728b867dc16bbe46e9aa61015b7d124..6d01de4343d2084725104d220eea1b806f863fd2 100644 (file)
@@ -55,7 +55,9 @@ class SessionAccessLogListener implements IParameterizedEventListener {
                        // Fetch request URI + request ID (if available).
                        $requestURI = UserUtil::getRequestURI();
                        if ($requestId = \wcf\getRequestId()) {
-                               $requestURI .= ' ('.$requestId.')';
+                               $requestIdSuffix = ' ('.$requestId.')';
+                               // Ensure that the request ID fits by truncating the URI.
+                               $requestURI = substr($requestURI, 0, 255 - strlen($requestIdSuffix)).$requestIdSuffix;
                        }
                        
                        // Get controller name + the AJAX action.