Email a friend captcha does not work (v. 2.8x)
If register globals is enabled, the 'cptcha' post variable is coming through as a global variable into the script, overriding the session variable. To fix this, we have to rename the session as 'scptcha'. This will be corrected in the next release.
Upgrade to the latest release. Or you can manually change your files by changing the session from 'cptcha' to 'scptcha' as follows:
-
/captcha/captcha.php
Change:
if (isset($_SESSION['cptcha']) AND ctype_alnum($_SESSION['cptcha'])) $thisrndcaptcha = substr(md5($_SESSION['cptcha']), 4, 8);
to:
if (isset($_SESSION['scptcha']) AND ctype_alnum($_SESSION['scptcha'])) $thisrndcaptcha = substr(md5($_SESSION['scptcha']), 4, 8);
-
/enc/formaccept.php
Change:
$procsesscaptcha = str_replace("0", "O", str_replace("1", "I", trim(strtoupper(substr(md5($_SESSION['cptcha']), 4, 8))))); if (empty($_SESSION['cptcha']) OR empty($_POST['cptcha']) OR $procformcaptcha != $procsesscaptcha)to:
$procsesscaptcha = str_replace("0", "O", str_replace("1", "I", trim(strtoupper(substr(md5($_SESSION['scptcha']), 4, 8))))); if (empty($_SESSION['scptcha']) OR empty($_POST['cptcha']) OR $procformcaptcha != $procsesscaptcha) -
/go/email.php, /enc/contact.php, /enc/guestbook.php, /enc/wholesale.php
Change:
$cptcha = md5(uniqid(rand(), true)); $_SESSION['cptcha'] = $cptcha;
to:
$sesscptcha = md5(uniqid(rand(), true)); $_SESSION['scptcha'] = $sesscptcha;