/** * @return string */ private function getInstanceId() { $instanceId = $this->getUrlParameter('t'); if (!\BDC_StringHelper::HasValue($instanceId) || !\BDC_CaptchaBase::IsValidInstanceId($instanceId)) { return; } return $instanceId; }
return $canonical; } // 2. include required base class declarations require_once BDC_INCLUDE_PATH . 'CaptchaIncludes.php'; // 3. include BotDetect configuration // a) mandatory global config, located in lib path require_once BDC_INCLUDE_PATH . 'CaptchaConfigDefaults.php'; // b) optional config override function BDC_ApplyUserConfigOverride($CaptchaConfig, $CurrentCaptchaId) { $BotDetect = clone $CaptchaConfig; $BDC_ConfigOverridePath = BDC_CONFIG_OVERRIDE_PATH . 'CaptchaConfig.php'; if (is_file($BDC_ConfigOverridePath)) { include $BDC_ConfigOverridePath; CaptchaConfiguration::ProcessGlobalDeclarations($BotDetect); // 2nd pass correctly takes global declarations such as DisabledImageStyles into account // even if they're declared after affected values in the CaptchaConfig.php file // e.g. ImageStyle setting needs to be re-calculated according to DisabledImageStyles value include $BDC_ConfigOverridePath; } return $BotDetect; } // 4. determine is this file included in a form/class, or requested directly $BDC_RequestFilename = basename($_SERVER['REQUEST_URI']); if (BDC_StringHelper::StartsWith($BDC_RequestFilename, 'botdetect.php')) { // direct access, proceed as Captcha handler (serving images and sounds) require_once BDC_INCLUDE_PATH . 'CaptchaHandler.php'; } else { // included in another file, proceed as Captcha class (form helper) require_once BDC_INCLUDE_PATH . 'CaptchaClass.php'; }
/** * @return string */ private function getInstanceId() { $instanceId = $this->request->query('t'); if (!\BDC_StringHelper::HasValue($instanceId) || !\BDC_CaptchaBase::IsValidInstanceId($instanceId)) { return; } return $instanceId; }