From de347f03875f083e5ab44787387f0507fd453a8c Mon Sep 17 00:00:00 2001 From: Michael Save Date: Thu, 19 Apr 2012 01:32:02 +1000 Subject: [PATCH] don't use CRC32 --- inc/anti-bot.php | 2 +- install.php | 4 +++- install.sql | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/inc/anti-bot.php b/inc/anti-bot.php index b5fcf2a1..4509505e 100644 --- a/inc/anti-bot.php +++ b/inc/anti-bot.php @@ -190,7 +190,7 @@ function _create_antibot($board, $thread) { $query->bindValue(':expires', $config['spam']['hidden_inputs_expire']); $query->execute() or error(db_error($query)); - $query = prepare('INSERT INTO `antispam` VALUES (:board, :thread, CRC32(:hash), UNIX_TIMESTAMP(), NULL, 0)'); + $query = prepare('INSERT INTO `antispam` VALUES (:board, :thread, :hash, UNIX_TIMESTAMP(), NULL, 0)'); $query->bindValue(':board', $board); $query->bindValue(':thread', $thread); $query->bindValue(':hash', $antibot->hash()); diff --git a/install.php b/install.php index 364de21a..2e732c4c 100644 --- a/install.php +++ b/install.php @@ -1,7 +1,7 @@ bindValue(':oldboard', $board['id']); $query->execute() or error(db_error($query)); } + case 'v0.9.6-dev-3': + query("ALTER TABLE `antispam` CHANGE `hash` `hash` CHAR( 40 ) NOT NULL") or error(db_error()); case false: // Update version number file_write($config['has_installed'], VERSION); diff --git a/install.sql b/install.sql index a24a47c0..a13453ff 100644 --- a/install.sql +++ b/install.sql @@ -29,7 +29,7 @@ SET time_zone = "+00:00"; CREATE TABLE IF NOT EXISTS `antispam` ( `board` varchar(255) NOT NULL, `thread` int(11) DEFAULT NULL, - `hash` bigint(20) NOT NULL, + `hash` char(40) NOT NULL, `created` int(11) NOT NULL, `expires` int(11) DEFAULT NULL, `passed` smallint(6) NOT NULL,