Spam Protector Issue: Captchas not showing!!

Found a bug? Tell us!!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Similar Problems

Post by garvinhicking »

lubinio: Okay, your phpinfo() looks sane.

You can check for the *.ttf files inside your serendipity/plugins/serendipity_event_spamblock/ folder, there should be a couple of ttf files lying around.

As you already figured out, you can influence the background and I really think that your TTF-PHP functions behave strangely. Maybe you can talk to your provider and ask him if there are known issues with the TTF-functions? Or maybe your *.ttf files are just missing or are not readable.

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/
rahul

CAPTCHA not working for me too...

Post by rahul »

I downloaded wget and ran
wget http://172.19.60.26/serendipitydemo/ind ... l#comments

It created a dump file. But there were no php errors in that.
But when i ran that file in browser, it also displayed no capcha image.

So, i copied the link to which it referred in the dump file and ran....

wget http://172.19.60.26/serendipitydemo/ind ... e4ef65b217

Now, the new dump that was generated contained some errors with some machine code at the end...

Code: Select all

<br />
<b>Warning</b>:  imagettftext(): Could not find/open font in <b>D:\Apache Group\Apache2\htdocs\serendipitydemo\plugins\serendipity_event_spamblock\serendipity_event_spamblock.php</b> on line <b>750</b><br />
<br />
<b>Warning</b>:  imagettftext(): Could not find/open font in <b>D:\Apache Group\Apache2\htdocs\serendipitydemo\plugins\serendipity_event_spamblock\serendipity_event_spamblock.php</b> on line <b>750</b><br />
<br />
<b>Warning</b>:  imagettftext(): Could not find/open font in <b>D:\Apache Group\Apache2\htdocs\serendipitydemo\plugins\serendipity_event_spamblock\serendipity_event_spamblock.php</b> on line <b>750</b><br />
<br />
<b>Warning</b>:  imagettftext(): Could not find/open font in <b>D:\Apache Group\Apache2\htdocs\serendipitydemo\plugins\serendipity_event_spamblock\serendipity_event_spamblock.php</b> on line <b>750</b><br />
<br />
<b>Warning</b>:  imagettftext(): Could not find/open font in <b>D:\Apache Group\Apache2\htdocs\serendipitydemo\plugins\serendipity_event_spamblock\serendipity_event_spamblock.php</b> on line <b>750</b><br />
ÿØÿà
Can we track the error using this?
Also... i have the following ttf files in the specified folder:
Vera.ttf
VeraSe.ttf
chumbly.ttf
36daysago.ttf

Along with this i have all png files and
lang_ja.inc.php
serendipity_event_spamblock.php

Now, what shud i do next to make the problem more clear?

Thanks a Lot and Regards,
Rahul
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: CAPTCHA not working for me too...

Post by garvinhicking »

Rahul, please edit your plugins/serendipity_event_spamblock/serendipity_event_spamblock.php file and go to line 718.

Please modify the code there to this:

Code: Select all

         $font     = $serendipity['serendipityPath'] . 'plugins/serendipity_event_spamblock/' . $fontname;

         if (!file_exists($font)) {
             // Search in shared plugin directory
             $font = S9Y_INCLUDE_PATH . 'plugins/serendipity_event_spamblock/' . $fontname;
         }

         if (!file_exists($font)) {
             die(PLUGIN_EVENT_SPAMBLOCK_ERROR_NOTTF);
         }

die('USING FILE: ' . $font);
Note that last die() line, this is what I need.

It seems that imagettf() needs to have the absolute path to your font file, so $serendipity['serendipityPath'] should be something like "d:/Apache Group/Apache2/htdocs/serendipitydemo/", so with your full harddrive letter setup.

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/
rahul

CAPTCHA not working for me too...

Post by rahul »

I applied that die statement. But still no image is being displayed.
Restarted the server and the browser... still no image displayed.

Please suggest me what all R & D can i do to get it working !

Regards,
Rahul
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: CAPTCHA not working for me too...

Post by garvinhicking »

Rahul: Yes of course it will display no image. But it will display an error inside your output you got via WGET. This is what I requested. :)

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/
rahulmunjal
Regular
Posts: 27
Joined: Thu May 05, 2005 6:44 am
Location: Bangalore, India

CAPTCHA not working for me too...

Post by rahulmunjal »

This is the content of the command:

wget http://172.19.60.26/serendipitydemo/ind ... cf1968f08e

USING FILE: D:/Apache Group/Apache2/htdocs/serendipitydemo/plugins/serendipity_event_spamblock/Vera.ttf


And i checked the font. It's available in the folder.

:cry:

What else can we check for? :roll:
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: CAPTCHA not working for me too...

Post by garvinhicking »

Rahul: Well...in that case your imagettf() function is failing on your System, there's something wrong with TTF+GDlib support there.

Aren't you facing a similar problem in the Todolist plugin where your text creation fails?

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/
rahulmunjal
Regular
Posts: 27
Joined: Thu May 05, 2005 6:44 am
Location: Bangalore, India

Re: CAPTCHA not working for me too...

Post by rahulmunjal »

I faced the problem in ToDo List also. But it's solved now. Now, the images are generated and its working well.

Anyways, now what should I do? What all can be done to make the things working??

Regards,
Rahul
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: CAPTCHA not working for me too...

Post by garvinhicking »

Rahul, what was the solution in the todolist plugin? This needs to be done in the spamblock plugin then as well?

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/
rahulmunjal
Regular
Posts: 27
Joined: Thu May 05, 2005 6:44 am
Location: Bangalore, India

Re: CAPTCHA not working for me too...

Post by rahulmunjal »

garvinhicking wrote:Rahul, what was the solution in the todolist plugin? This needs to be done in the spamblock plugin then as well?

Regards
,Garvin
There, the images are static now... Whenever the image gets generated, it's stored in the templates_c folder.
I dont remember doing much for that. Just restarted the server and the browser worked out and images got displayed. But still, there is the same problem with "Manage Colors" section where the sample Images are not getting displayed.
Please check the Spam Protector Plugin Thread under the Plugins Section in the forum for the things that i was asked to do.

Don't have any idea about this.
Please suggest me what to upgrade and from where.
Regards,
Rahul
Nicola

CAPTCHA-Img broken - Err. in serendipity_event_spamblock.php

Post by Nicola »

Hi!

I got the same prob with broken CAPTCHA-Images. When I look into the Images I see this error message:
*** snip ***
<br />
<b>Warning</b>: mt_rand(): Invalid range: 5..3 in <b>/home/pages/unstraublich.de/serendipity/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php</b> on line <b>785</b><br />
ÿØÿà JFIF ÿþ ;CREATOR: gd-jpeg v2.0 (using IJG JPEG v62), quality = 90
ÿÛ C
*** snap ***

followed by a lot of binary.

Line 785 of serendipity_event_spamblock.php is:
*** snip ***
$strings = array_rand($this->chars, mt_rand($max_char, $min_char));
*** snap ***

I've not changed anything. Error in image file can be reproduced:
http://www.unstraublich.de/serendipity/

Any suggestions?

Also I have probs with the Mediadatenbank (Warning: Supplied resource is not a valid File-Handle resource in /home/pages/unstraublich.de/serendipity/include/functions_images.inc.php on line 1215)

and with Data Import - Systems seems to freeze when clicking the 'Daten importieren'-Link. I haven't looked into these probs so far, just want to mention it, in case it triggers some ideas....

Thanks for your time!

Nicola Straub
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: CAPTCHA-Img broken - Err. in serendipity_event_spamblock

Post by garvinhicking »

Nicola, there seems to be a problem with your PHP version. Which one are you running?

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/
Guest

Re: CAPTCHA-Img broken - Err. in serendipity_event_spamblock

Post by Guest »

Hi Garvin!

[quote="garvinhicking"]Nicola, there seems to be a problem with your PHP version. Which one are you running?

Yupp, we traced it down to a few probs: GD is 2.0, but some functions that are used are
included in 2.0.1 and higher, like imagecreatetruecolor etc. So wie replaced these
functions in function_images_inc.php with functions from the older GD. This did it!

Still sometimes there is a problem with a font, that 'paints' special characters
instead of normal ones which results in pics noone will understand. Since _this_
installation is for privat use only I don't bother at the moment - anyway I will mail to my
provider so that I might get an updated GD. I will return, if the probs still ocur then.

Then there was used 'fclose' (or so - _I_ am no programmer, my husband did this work)
in the script, where the PHP manual stated, that one has to use closedir if opendir was
used initially. Thats around line 1215 - since my sweetheart marked his hacks I don't
know which line it was initially. That was only causing a warning I hope I get it all right,
I could sent you the hack, I you like.

Also the media database ('Mediendatenbank' is running now, only it can't handle GIF,
thanks to the old GD also.

I still have probs with data import and a question around the quick search-field. Will look
for or open threads more suitable for that.

Anyway: I really love your blogsystem, exsecially creating own templates is really
beautiful because of the great system - most things can be done with css alone! Thanks!

Nicola
gizmola
Regular
Posts: 37
Joined: Mon Oct 25, 2004 11:54 pm

Post by gizmola »

Update on my problem:

I finally figured out the problem on my server, and it was that the ttf files were corrupt. I'm not 100% sure how they got that way. I got them from cvs, and I verified that they were set to ascii, which of course is wrong.

This would explain why they were garbage when I uploaded them to the server. When I have time, I'll do a fresh get from cvs, and see if they're marked incorrectly.

It's also important that if people are ftping, that the upload is using binary mode, or the same problem can occur.

At any rate, the version of those files in the download archive are just fine, so simply replacing them on the server did the trick and captchas are once again working fine.

Just one thing to double check, if everything else seems to be in order.
Post Reply