Post by mspot » Fri Nov 06, 2009 3:34 pm

Is it me or the captcha image in reviews and contact form disappeared?
Default new installation of 1.3.3 (check http://133testshop.e-lasithi.gr/)
On the same server same configuration captcha in 1.3.2 works without a problem.

## UPDATE ##

Gzip compression is causing the error. If you set it (compression level) to zero the problem goes away.

Any quick fix for Gzip?

Newbie

Posts

Joined
Fri Nov 06, 2009 2:54 pm

Post by mspot » Sun Nov 08, 2009 4:01 am

I apologize. Actually I forgot the gzip compression setting to 0, so you couldn't see the error ( http://133testshop.e-lasithi.gr ). I changed that to 4 and now you can see it.

Newbie

Posts

Joined
Fri Nov 06, 2009 2:54 pm

Post by Daniel » Sun Nov 08, 2009 5:19 am

its just comming up that nothing is there.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by mspot » Sun Nov 08, 2009 6:57 am

Daniel wrote:its just comming up that nothing is there.
I don't understand what you mean.
In order to "see" the error you must visit the "Reviews" section of a product or the Contact form. The (captcha) image simply doesn' t appear.

Newbie

Posts

Joined
Fri Nov 06, 2009 2:54 pm

Post by Daniel » Sun Nov 08, 2009 7:41 am

this has to be something to do with your server.

it works fine on my demo site or dev site.

maybe the html is already sent out compressed.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by mspot » Sun Nov 08, 2009 7:47 am

On the very same server, same settings (gzip compression = 4) version 1.3.2 works flawlessly. Check it out.
http://testshop.e-lasithi.gr

By the way server in Centos 5 Apache 2.2.3 PHP 5.2.9

#UPDATE#

It seems the problems come from the file /system/library/responce.php
When I replace this file with the old one from version 1.3.2 everything works again ^-^

There are some differences in those files

responce.php 1.3.3

Code: Select all

line 26>> if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false) {
			$encoding = 'gzip';
		} 

line 30>> if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip') !== false) {
			$encoding = 'x-gzip';

line 66>> header($key . ': ' . $value);
responce.php 1.3.2

Code: Select all

line 26>> if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) {
			$encoding = 'gzip';
		} 

line 30>> if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip')) {
			$encoding = 'x-gzip';
line 66>>header($key. ': ' . $value);

Newbie

Posts

Joined
Fri Nov 06, 2009 2:54 pm

Post by Daniel » Sun Nov 08, 2009 10:13 am

if you use the old version then it won't compress the out put.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by mspot » Sun Nov 08, 2009 2:23 pm

OK I give up :(
Something else might be the problem...
All I know is that version 1.3.2 doesn't seem to have this problem while 1.3.3 does ! (On the same server and domain!).
I hope you come up with an idea Daniel.
Either way OpenCart Rocks

Newbie

Posts

Joined
Fri Nov 06, 2009 2:54 pm

Post by JNeuhoff » Mon Nov 09, 2009 11:10 pm

There is indeed a bug.

Use this showImage function in file system/library/captcha.php:

Code: Select all

	function showImage() {
		$image = imagecreatetruecolor($this->height, $this->width);

		$width = imagesx($image); 
		$height = imagesy($image);
		
		$black = imagecolorallocate($image, 0, 0, 0); 
		$white = imagecolorallocate($image, 255, 255, 255); 
		$red = imagecolorallocatealpha($image, 255, 0, 0, 75); 
		$green = imagecolorallocatealpha($image, 0, 255, 0, 75); 
		$blue = imagecolorallocatealpha($image, 0, 0, 255, 75); 
		
		imagefilledrectangle($image, 0, 0, $width, $height, $white); 
		
		imagefilledellipse($image, ceil(rand(5, 145)), ceil(rand(0, 35)), 30, 30, $red); 
		imagefilledellipse($image, ceil(rand(5, 145)), ceil(rand(0, 35)), 30, 30, $green); 
		imagefilledellipse($image, ceil(rand(5, 145)), ceil(rand(0, 35)), 30, 30, $blue); 

		imagefilledrectangle($image, 0, 0, $width, 0, $black); 
		imagefilledrectangle($image, $width - 1, 0, $width - 1, $height - 1, $black); 
		imagefilledrectangle($image, 0, 0, 0, $height - 1, $black); 
		imagefilledrectangle($image, 0, $height - 1, $width, $height - 1, $black); 
		
		imagestring($image, 10, intval(($width - (strlen($this->code) * 9)) / 2),  intval(($height - 15) / 2), $this->code, $black);
	
		header('Content-Type: image/png');
		
		imagepng($image);
		
		imagedestroy($image);
		exit;
	}


MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Rich Snippets * Google Tag Manager * Export/Import Tool * SpamBot Buster


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by mspot » Tue Nov 10, 2009 5:45 am

God sent man.

Thanx

Newbie

Posts

Joined
Fri Nov 06, 2009 2:54 pm

Post by cc6264 » Tue Nov 10, 2009 5:52 am

Thankyou - that fixed it!

Cheers
CraigG

Newbie

Posts

Joined
Fri Oct 09, 2009 9:29 am
Location - Sydney,Australia
Who is online

Users browsing this forum: No registered users and 7 guests