Spam Protector Issue: Captchas not showing!!

Found a bug? Tell us!!
dorian2727
Regular
Posts: 7
Joined: Fri Jan 28, 2005 5:12 am

Spam Protector Issue: Captchas not showing!!

Post by dorian2727 »

The plugin is showing in the comment section, but the Captchas are not showing. See link

http://www.redstaterant.com/archives/24 ... l#comments

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

Re: Spam Protector Issue: Captchas not showing!!

Post by garvinhicking »

Please look at your spam protector config. By default captchas are only shown for articles older than 7 days.

Please post a screnshot (or 2 screenshots) how your spam protector config looks like!

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/
dorian2727
Regular
Posts: 7
Joined: Fri Jan 28, 2005 5:12 am

CAPTCHAS

Post by dorian2727 »

I had set the setting to "0" so the captchas would show all the ime, but it still did the same thing. It shows the empty boxes where to images should be.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: CAPTCHAS

Post by garvinhicking »

"Please post a screnshot (or 2 screenshots) how your spam protector config looks like! " :)

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/
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Screenshots

Post by garvinhicking »

Hm, okay. Your plugin configuration really looks good.

However I don't know why the plugin is not fetched. This may be a serendipity 0.7.1 issue, but I sadly don't have a 0.7.1 installation at hand or the time to create one. Would you maybe have the time to try a 0.8 installation or give me FTP access to your machine so that I can check?

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/
dorian2727
Regular
Posts: 7
Joined: Fri Jan 28, 2005 5:12 am

Upgrade

Post by dorian2727 »

Will upgrading overwrite any of what I have designed on the site?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Upgrade

Post by garvinhicking »

It shouldn't - please read the 0.8 migration doc at http://www.s9y.org/63.html

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

No captchas

Post by pano »

I made a fresh installing of 0.8 beta 5, and my captchas does not show.
The route of image points to index.php?/plugin/captcha.... and there is no such directory.

I looked for this bug in forum, but i did not find any solution. Is this a not fixed bug? Or something is wrong with my captchas?

I had to disable captchas while they do not show.

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

Re: No captchas

Post by garvinhicking »

Can you please activate it again and post the full URL to your blog? Then I'll have another look at it. It may be that some other plugins are interfering and sending output.

This can especially be if you once modified a plugin or copy+pasted code somewhere and introduced extra spaces at the top or end of the file.

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

Post by pano »

I activated it again.
You can see it in action in www.casarusia.com

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

Post by garvinhicking »

Pano, thanks a lot for reactivating it again. I think we're near to finding the error.

Please open your file plugins/serendipity_event_spamblock/serendipity_event_spamblock.php

There go to line 758 and find this piece of code:

Code: Select all

                        header('Content-Type: image/png');
                        $output_char = strtolower($_SESSION['spamblock']['captcha']{$parts[1] - 1});
                        $cap = $serendipity['serendipityPath'] . 'plugins/serendipity_event_spamblock/captcha_' . $output_char . '.png';
                        if (!file_exists($cap)) {
                            $cap = S9Y_INCLUDE_PATH . 'plugins/serendipity_event_spamblock/captcha_' . $output_char . '.png';
                        }

                        if (file_exists($cap)) {
                            echo file_get_contents($cap);
                        }
please modify this to that:

Code: Select all

                        header('Content-Type: image/png');
                        $output_char = strtolower($_SESSION['spamblock']['captcha']{$parts[1] - 1});
                        header('X-Spamblock-Char: ' . $output_char);
                        $cap = $serendipity['serendipityPath'] . 'plugins/serendipity_event_spamblock/captcha_' . $output_char . '.png';
                        header('X-Spamblock-File: ' . $cap);
                        if (!file_exists($cap)) {
                            $cap = S9Y_INCLUDE_PATH . 'plugins/serendipity_event_spamblock/captcha_' . $output_char . '.png';
                            header('X-Spamblock-File2: ' . $cap);
                        }

                        if (file_exists($cap)) {
                            header('X-Spamblock-Readable: true');
                            echo file_get_contents($cap);
                        } else {
                            header('X-Spamblock-Readable: false');
                        }
I added some debugging code there which will help me to analyze the problem. Once you have implemented that into the file, please report back. Then I will analyze the HTTP headers using the mozdev LiveHTTPHeaders tool when calling this url: http://www.casarusia.com/index.php?/plu ... c8fd464cc1

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/
pano
Regular
Posts: 24
Joined: Tue Apr 05, 2005 11:15 am

Post by pano »

I already replaced the code you wrote in the spamblock file.

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

Post by garvinhicking »

Pano, okay.

These are the headers I get:

Code: Select all

X-Spamblock-Char: 7
X-Spamblock-File: /home/casaru/public_html/plugins/serendipity_event_spamblock/captcha_7.png
X-Spamblock-Readable: true
That means, serendipity can read the file "/home/casaru/public_html/plugins/serendipity_event_spamblock/captcha_7.png", and it should get displayed because of this code:

Code: Select all

echo file_get_contents($cap);
inside the spamblock plugin. But strangely, this function does not return a thing!

So there are two possible causes: First, the file captcha_7.png inside your plugin directory is empty or is not readable.

Second, a PHP function or safemode features fails on your host. To check this, please insert those lines after the line

Code: Select all

header('X-Spamblock-Readable: true');
// Insert those lines:
ini_set('display_errors', 'on');
error_reporting(E_ALL);
With this you should hopefully get an error message why the file cannot be opened!

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/
pano
Regular
Posts: 24
Joined: Tue Apr 05, 2005 11:15 am

Post by pano »

Really strange... i added the new code and i do not get any error.
Only captchas are still hidden.
The png files are ok, i can see them if i write the full path in a browser.

Maybe something wrong with gdlib? But it works with other scripts i have in the same server...

Best,
pano
Post Reply