OC 1.5.1.3, the Captcha image doesn't show on none of these pages:
I can't see any errors (Apache logs / error.txt file). I can't see any spaces within the language files - in fact I've redownloaded the entire EN package just to make sure..
I suspect a broken dependency (even if I have GD.. there must be something else..); disabled entirely caching - need assistance!
Back in 2009 I've found trails of such errors on forums but it seems there was a language-file problem, meaning trails of spaces were sending the page headers earlier than normal - but I've checked most of the files I thought to be involved and I've cleaned all the extra spaces - with no result.
Thanks, Bogdan
FYI I had this same problem and this solution (change to system\library\captcha.php) did make the captcha image display successfully and the form passes validation:
function getCode(){
$out = ob_get_contents();
$out = str_replace(array("\n", "\r", "\t", " "), "", $this->code);
ob_end_clean();
return $out;
}
For OC 1.5.* Go to
system\library\captcha.php
Find function getCode()
Replace this function to
function getCode(){
$code= ob_get_contents();
$code= str_replace(array("\n", "\r", "\t", " "), "", $this->code);
ob_end_clean() return $code; }
Now For OC 2.1.* Go to
Catalog/controller/captcha/basic-captcha
Find $this->session->data['captcha'] = substr(sha1(mt_rand()), 17, 6);
place below code after this
$code= ob_get_contents();
$code= str_replace(array("\n", "\r", "\t", " "), "",$this->session->data['captcha']);
ob_end_clean();
$this->session->data['captcha'] = $code;
And For OC 2.3.* Go to
Catalog/controller/Extension/captcha/basic-captcha.php Find
$this->session->data['captcha'] = substr(sha1(mt_rand()), 17, 6);
Place below code after this
$code= ob_get_contents();
$code= str_replace(array("\n", "\r", "\t", " "), "",$this->session->data['captcha']);
ob_end_clean();
$this->session->data['captcha'] = $code;
Its helpfull !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With