mirror of
https://github.com/Mibew/tray.git
synced 2025-01-22 18:10:34 +03:00
Use md5 hashes as request buffer keys
This commit is contained in:
parent
d4e51d3dfd
commit
b96c9d0a2c
@ -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"
|
||||
),
|
||||
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user