• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/captcha.php
  • Класс: CCaptcha
  • Вызов: CCaptcha::CheckCodeCrypt
function CheckCodeCrypt($userCode, $codeCrypt, $password = "", $bUpperCode = true)
{
	if (!defined("CAPTCHA_COMPATIBILITY"))
		return CCaptcha::CheckCaptchaCode($userCode, $codeCrypt, $bUpperCode);

	if ($codeCrypt == '')
		return false;

	if (!BitrixMainApplication::getInstance()->getSession()->get("CAPTCHA_PASSWORD"))
		return false;

	if ($bUpperCode)
		$userCode = mb_strtoupper($userCode);

	$code = $this->CryptData($codeCrypt, "D", BitrixMainApplication::getInstance()->getSession()["CAPTCHA_PASSWORD"]);

	if ($code != $userCode)
		return false;

	return true;
}