From: Tim Düsterhus Date: Wed, 14 Oct 2020 12:21:53 +0000 (+0200) Subject: Stop accessing the ->requestURI/Method properties of the session X-Git-Tag: 5.4.0_Alpha_1~724^2~10^2~9 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7513ca57715d2bda8f68169213c5d9280aad5fae;p=GitHub%2FWoltLab%2FWCF.git Stop accessing the ->requestURI/Method properties of the session Use UserUtil / $_SERVER instead. --- diff --git a/wcfsetup/install/files/lib/system/event/listener/SessionAccessLogListener.class.php b/wcfsetup/install/files/lib/system/event/listener/SessionAccessLogListener.class.php index ccdfaf02c4..82b301de3a 100644 --- a/wcfsetup/install/files/lib/system/event/listener/SessionAccessLogListener.class.php +++ b/wcfsetup/install/files/lib/system/event/listener/SessionAccessLogListener.class.php @@ -52,7 +52,7 @@ class SessionAccessLogListener implements IParameterizedEventListener { } // format request uri - $requestURI = WCF::getSession()->requestURI; + $requestURI = UserUtil::getRequestURI(); // remove directories $URIComponents = explode('/', $requestURI); $requestURI = array_pop($URIComponents); @@ -65,7 +65,7 @@ class SessionAccessLogListener implements IParameterizedEventListener { 'ipAddress' => UserUtil::getIpAddress(), 'time' => TIME_NOW, 'requestURI' => $requestURI, - 'requestMethod' => WCF::getSession()->requestMethod, + 'requestMethod' => substr($_SERVER['REQUEST_METHOD'] ?? '', 0, 255), 'className' => get_class($eventObj) ]); } diff --git a/wcfsetup/setup/db/install.sql b/wcfsetup/setup/db/install.sql index 873574528e..ee90113a58 100644 --- a/wcfsetup/setup/db/install.sql +++ b/wcfsetup/setup/db/install.sql @@ -111,7 +111,7 @@ CREATE TABLE wcf1_acp_session_access_log ( ipAddress VARCHAR(39) NOT NULL DEFAULT '', time INT(10) NOT NULL DEFAULT 0, requestURI VARCHAR(255) NOT NULL DEFAULT '', - requestMethod VARCHAR(7) NOT NULL DEFAULT '', + requestMethod VARCHAR(255) NOT NULL DEFAULT '', className VARCHAR(255) NOT NULL DEFAULT '', KEY sessionLogID (sessionLogID) );