diff --git a/src/messenger/webim/install/dbinfo.php b/src/messenger/webim/install/dbinfo.php index b6197866..0026e364 100644 --- a/src/messenger/webim/install/dbinfo.php +++ b/src/messenger/webim/install/dbinfo.php @@ -59,7 +59,8 @@ $dbtables = array( "${mysqlprefix}requestbuffer" => array( "requestid" => "int NOT NULL auto_increment PRIMARY KEY", - "requestkey" => "varchar(128) NOT NULL", + // Use MD5 hashes as keys + "requestkey" => "char(32) NOT NULL", "request" => "text NOT NULL" ), diff --git a/src/messenger/webim/libs/classes/client_side_processor.php b/src/messenger/webim/libs/classes/client_side_processor.php index b227a7bf..9585e685 100644 --- a/src/messenger/webim/libs/classes/client_side_processor.php +++ b/src/messenger/webim/libs/classes/client_side_processor.php @@ -60,7 +60,7 @@ abstract class ClientSideProcessor extends RequestProcessor { $db = Database::getInstance(); $db->query( "INSERT INTO {requestbuffer} (request, requestkey) VALUES (:request, :key)", - array(':request' => serialize($request), ':key' => $key) + array(':request' => serialize($request), ':key' => md5($key)) ); } @@ -72,6 +72,9 @@ abstract class ClientSideProcessor extends RequestProcessor { */ protected function getRequestsFromBuffer($key) { $db = Database::getInstance(); + + $key = md5($key); + // Get requests from database $requests = $db->query( "SELECT request FROM {requestbuffer} WHERE requestkey = :key",