Bug in spam-plugin (no spamblocklog-table)
Posted: Sun Aug 12, 2007 10:42 am
On a fresh install of the anti-spamplugin I missed the table ${prefix}_spamblocklog so I had a look into it and found a bug.
function checkScheme:
This means, that a fresh install will set $version to '1.1' and the following if does check for 1.0 (while it possible should check for <1.0) and a new version is never set.
A simple fix:
This created the right table for me too (possibly because 'version' was never set before).
function checkScheme:
Code: Select all
$version = $this->get_config('version', '1.1');
if ($version != '1.0') {
// [install spamhtaccess-table]
} elseif ($version != $maxVersion) {
// [install spamblocklog-table]
// [install spamhtaccess-table]
// [set version = maxversion]
A simple fix:
Code: Select all
$ svn diff
Index: serendipity_event_spamblock.php
===================================================================
--- serendipity_event_spamblock.php (revision 1841)
+++ serendipity_event_spamblock.php (working copy)
@@ -571,7 +571,7 @@
$version = $this->get_config('version', '1.1');
- if ($version != '1.0') {
+ if (version_compare($version, '1.0', '<')) {
$q = "CREATE TABLE {$serendipity['dbPrefix']}spamblock_htaccess (
timestamp int(10) {UNSIGNED} default null,
ip varchar(15))";