1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-27 17:00:52 +01:00

don't use CRC32

This commit is contained in:
Michael Save 2012-04-19 01:32:02 +10:00
parent a340c5b6ee
commit de347f0387
3 changed files with 5 additions and 3 deletions

View File

@ -190,7 +190,7 @@ function _create_antibot($board, $thread) {
$query->bindValue(':expires', $config['spam']['hidden_inputs_expire']); $query->bindValue(':expires', $config['spam']['hidden_inputs_expire']);
$query->execute() or error(db_error($query)); $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(':board', $board);
$query->bindValue(':thread', $thread); $query->bindValue(':thread', $thread);
$query->bindValue(':hash', $antibot->hash()); $query->bindValue(':hash', $antibot->hash());

View File

@ -1,7 +1,7 @@
<?php <?php
// Installation/upgrade file // Installation/upgrade file
define('VERSION', 'v0.9.6-dev-3'); define('VERSION', 'v0.9.6-dev-4');
require 'inc/functions.php'; require 'inc/functions.php';
@ -208,6 +208,8 @@ if (file_exists($config['has_installed'])) {
$query->bindValue(':oldboard', $board['id']); $query->bindValue(':oldboard', $board['id']);
$query->execute() or error(db_error($query)); $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: case false:
// Update version number // Update version number
file_write($config['has_installed'], VERSION); file_write($config['has_installed'], VERSION);

View File

@ -29,7 +29,7 @@ SET time_zone = "+00:00";
CREATE TABLE IF NOT EXISTS `antispam` ( CREATE TABLE IF NOT EXISTS `antispam` (
`board` varchar(255) NOT NULL, `board` varchar(255) NOT NULL,
`thread` int(11) DEFAULT NULL, `thread` int(11) DEFAULT NULL,
`hash` bigint(20) NOT NULL, `hash` char(40) NOT NULL,
`created` int(11) NOT NULL, `created` int(11) NOT NULL,
`expires` int(11) DEFAULT NULL, `expires` int(11) DEFAULT NULL,
`passed` smallint(6) NOT NULL, `passed` smallint(6) NOT NULL,