Browse Source

don't use CRC32

pull/40/head
Michael Save 12 years ago
parent
commit
de347f0387
  1. 2
      inc/anti-bot.php
  2. 4
      install.php
  3. 2
      install.sql

2
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());

4
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);

2
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,

Loading…
Cancel
Save