Page 1 of 1

serendipity_event_spamblock error

Posted: Fri Jul 18, 2014 11:05 am
by jwoude
Hello,

In file plugins/serendipity_event_spamblock/serendipity_event_spamblock.php contains the following code:
$q = "CREATE TABLE {$serendipity['dbPrefix']}spamblock_htaccess (
timestamp int(10) {UNSIGNED} default null,
ip varchar(15))";

The declaration ip varchar(15) fails in case IPv6 is used. This should be at least varchar(45) as specified elsewhere.

Regards
Jos

Re: serendipity_event_spamblock error

Posted: Mon Jul 21, 2014 12:23 pm
by garvinhicking
Hi!

Actually this is more due to "compatibility" or "legacy" reasons. Later on in that code you should see an ALTER TABLE statement that should change this to varchar(45)!

Did this not work in your install? Then we should check how that happens, maybe there's an SQL compatibility issue.

Regards,
Garvin

Re: serendipity_event_spamblock error

Posted: Tue Jul 22, 2014 11:09 am
by jwoude
Hi Garvin,

I am using postgresql and I get many errors in the log like this one:

Jul 22 11:01:27 servix postgres[26074]: [2-1] ERROR: value too long for type character varying(15)
Jul 22 11:01:27 servix postgres[26074]: [2-2] STATEMENT: INSERT INTO serendipity_visitors (sessID,day,time,ref,browser,ip) values ('9m3qafst07u04rvel1340jq2f6', '2014-07-22', '09:01', 'unknown', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0', 'xxx:xxx:xxx:xxx:xxx:xxx:xxx:xxx').

I have some time this week and I will try to fix the postgresql errors.

Re: serendipity_event_spamblock error

Posted: Tue Jul 22, 2014 2:11 pm
by garvinhicking
Hi!


Ah, I suppose then the SQL we use to alter the table was not compatible with pgsql - we have added a switch to our code recently, but maybe when you installed the plugin, that wasn't the case yet.

Try to execute this SQL:

Code: Select all

ALTER TABLE serendipity_spamblocklog ALTER COLUMN ip TYPE VARCHAR(45)
ALTER TABLE serendipity_spamblock_htaccess ALTER COLUMN ip TYPE VARCHAR(45)
does it work, or do you get errors?

HTH,
Garvin