Clean up generation of request information for SQL queries
authorTim Düsterhus <duesterhus@woltlab.com>
Sun, 2 Feb 2020 15:03:59 +0000 (16:03 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Sun, 2 Feb 2020 15:05:19 +0000 (16:05 +0100)
wcfsetup/install/files/lib/system/database/Database.class.php

index b2d16505544b3a5d4d31ed4ecc5c60bea09bf6fa..13f67b297d3f7d4cdf252cd6d5214e8be31aa8fe 100644 (file)
@@ -263,8 +263,13 @@ abstract class Database {
                        if ($requestInformation === null) {
                                $requestInformation = '';
                                if (defined('ENABLE_PRODUCTION_DEBUG_MODE') && ENABLE_PRODUCTION_DEBUG_MODE && isset($_SERVER['REQUEST_URI'])) {
-                                       $requestInformation = substr($_SERVER['REQUEST_URI'].(\wcf\getRequestId() ? ' ('.\wcf\getRequestId().')' : ''), 0, 90);
+                                       $requestInformation = $_SERVER['REQUEST_URI'];
+                                       if ($requestId = \wcf\getRequestId()) {
+                                               $requestInformation = substr($requestInformation, 0, 70);
+                                               $requestInformation .= ' ('.$requestId.')';
+                                       }
                                        if (isset($_REQUEST['className']) && isset($_REQUEST['actionName'])) {
+                                               $requestInformation = substr($requestInformation, 0, 90);
                                                $requestInformation .= ' ('.$_REQUEST['className'].':'.$_REQUEST['actionName'].')';
                                        }
                                        $requestInformation = substr($requestInformation, 0, 180);