Commit 8b026b05 by Daniel Ruf Committed by Scott

eventlog saves IP addresses in plaintext

parent 5a74acfa
...@@ -1472,8 +1472,7 @@ ...@@ -1472,8 +1472,7 @@
// convert IP addresses to new binary format // convert IP addresses to new binary format
$eventlog_exists = (bool)qa_db_read_one_value(qa_db_query_sub("SELECT 1 FROM ^eventlog LIMIT 1")); $eventlog_exists = (bool)qa_db_read_one_value(qa_db_query_sub("SELECT 1 FROM ^eventlog LIMIT 1"));
if($eventlog_exists){ if($eventlog_exists){
qa_db_upgrade_query('ALTER TABLE ^eventlog MODIFY ipaddress VARBINARY(16) NULL DEFAULT NULL'); qa_db_upgrade_query('ALTER TABLE ^eventlog MODIFY ipaddress VARCHAR(45) CHARACTER SET ascii');
qa_db_upgrade_query('UPDATE ^eventlog SET ipaddress = UNHEX(HEX(CAST(ipaddress AS UNSIGNED)))');
} }
qa_db_upgrade_query('ALTER TABLE ^cookies MODIFY writeip VARBINARY(16) NULL DEFAULT NULL, MODIFY createip VARBINARY(16) NULL DEFAULT NULL'); qa_db_upgrade_query('ALTER TABLE ^cookies MODIFY writeip VARBINARY(16) NULL DEFAULT NULL, MODIFY createip VARBINARY(16) NULL DEFAULT NULL');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment