This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit

eZ Community » Forums » Setup & design » Big problem with the antispam extension

Big problem with the antispam extension

Big problem with the antispam extension

Sunday 18 March 2007 7:02:49 pm - 8 replies


I use the datatype extension for 2 months ago, and it always works fine, but since yesterday, I systematically get the validation error message, enven if I tape the write antispam code.

In order to "debug", I changed this in at the line 158 of the sckantispamtype.php

 if( $answer != $objectAttribute->content() )
                    $objectAttribute->setValidationError( "Antispam code is incorrect_[\$answer:]_".$answer."_[\$objectAttribute->content:]_".$objectAttribute->content());
                    return EZ_INPUT_VALIDATOR_STATE_INVALID;

So the error message is like this when the code displayed in the captcha is 00483 :

Antispam code is incorrect_[$answer:]_00483_[$objectAttribute->content:]_12482

It seems that $objectAttribute->content() doesn't contains the value that is used to make the captcha that is displayed at the end of the form, but I don't know why...

You can see this
at by trying to add a comment (button at the bottom of the page)

thanks in advance for your help !

Wednesday 21 March 2007 2:50:47 pm

please, did someone can try to help me a little ?

Wednesday 21 March 2007 3:18:33 pm

No one can see your install, you have http acl authentication on the url,

Why not output the expected value and the submitted value to debug this statement ... many people use this extension with success.


Wednesday 21 March 2007 3:20:04 pm

Hi Sébastien

The URL you are referring too seems to be password protected.

Did you recently upgrade to another version of eZ publish, or did you modify some templates which could be related to the issue?

Wednesday 21 March 2007 6:26:36 pm


Sorry for the htaccess protection, login is "dev" and password is "dev".

I don't made any upgrade or modification into related templates, moreother this bug is present in all classes that uses this datatype.

I have also replaced the extension/antispam folder, with the version avalaible on to avoid all doubt of file modification, but the bug is still here, and the code is too complex for me.

I know that this extention abitually works very well, I use it on many sites... I don't understand !

Wednesday 21 March 2007 11:31:54 pm

Hi Sébastien

I used the link you provided in your original post and I was able to submit a comment without a problem. Do you do anything special when it fails (submitting even though it won't validate, eg not filling out required information)?

Feel free to delete the comment I added happy.gif Emoticon

Thursday 22 March 2007 6:47:27 am

Hi Hans,

Yesterday I have tried to install the ezcaptcha extension in order to replace the antispam datatype, just to test.

So I have copied the files, activate the extension, and edited the comment class to replace the antispam datatype by the ezcaptcha datatype, but the edition doesn't save my modifications, I have tried many times, cleared all caches, the antispam datatype is still here, I can't delete it, and I can't add another attribute on my comment class.
Perhaps this is because she has many objects, but why don't I get an ezpublish error message when trying to edit this class ?

So to conclude, since this manipulations, all is ok, comments can be nicely added...

Today I have to check all the parameters (the comment class, extensions, templates, etc.) in order to understand the origin of this bug.

Thanks for your help ! (and for your contrib !)

Modified on Thursday 22 March 2007 6:48:38 am by Sébastien Antoniotti

Wednesday 24 September 2008 3:55:52 pm

2 Sébastien Antoniotti

There occurred an error in code of sckantispamtype.php v.1.1. To solve it:

1. Add including file at the top of the script
include_once( 'lib/ezutils/classes/ezinputvalidator.php' );

2. Change the original lines ## 161 and 166 so they look like
return eZInputValidator::STATE_INVALID;
return eZInputValidator::STATE_ACCEPTED;
instead of

Hope this fix will help someone who uses eZ Publish 4 + antispam extension happy.gif Emoticon

Monday 16 March 2009 1:29:04 pm

Hi! is good alternative for antispam


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from