serendipity_event_spamblock error

Creating and modifying plugins.
Post Reply
jwoude
Regular
Posts: 10
Joined: Sun May 12, 2013 3:20 pm

serendipity_event_spamblock error

Post by jwoude » Fri Jul 18, 2014 11:05 am

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

User avatar
garvinhicking
Core Developer
Posts: 30014
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: serendipity_event_spamblock error

Post by garvinhicking » Mon Jul 21, 2014 12:23 pm

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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

jwoude
Regular
Posts: 10
Joined: Sun May 12, 2013 3:20 pm

Re: serendipity_event_spamblock error

Post by jwoude » Tue Jul 22, 2014 11:09 am

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.

User avatar
garvinhicking
Core Developer
Posts: 30014
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: serendipity_event_spamblock error

Post by garvinhicking » Tue Jul 22, 2014 2:11 pm

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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

Post Reply