summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Save <savetheinternet@tinyboard.org>2012-04-19 01:32:02 +1000
committerMichael Save <savetheinternet@tinyboard.org>2012-04-19 01:33:53 +1000
commitde347f03875f083e5ab44787387f0507fd453a8c (patch)
tree7a9e0deaf1e5a6d6b1edbf7099c9e4add4728cbb
parenta340c5b6eec89d0e023fc606081ec857f44a0b3d (diff)
don't use CRC32
-rw-r--r--inc/anti-bot.php2
-rw-r--r--install.php4
-rw-r--r--install.sql2
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 @@
<?php
// Installation/upgrade file
-define('VERSION', 'v0.9.6-dev-3');
+define('VERSION', 'v0.9.6-dev-4');
require 'inc/functions.php';
@@ -208,6 +208,8 @@ if (file_exists($config['has_installed'])) {
$query->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,