/** * process_bot_trap * * @access public * @return void */ public static function process_bot_trap() { // what's your email address Mr. Bot ? $empty_trap = isset($_REQUEST['tkt-slctr-request-processor-email']) && $_REQUEST['tkt-slctr-request-processor-email'] == '' ? true : false; // get encrypted timestamp for when the form was originally displayed $bot_trap_timestamp = isset($_REQUEST['tkt-slctr-request-processor-token']) ? sanitize_text_field($_REQUEST['tkt-slctr-request-processor-token']) : ''; // decrypt and convert to absolute integer if (EE_Registry::instance()->CFG->registration->use_encryption) { EE_Registry::instance()->load_core('EE_Encryption'); $bot_trap_timestamp = absint(EE_Encryption::instance()->decrypt($bot_trap_timestamp)); } else { $bot_trap_timestamp = absint($bot_trap_timestamp); } // ticket form submitted too impossibly fast ( after now ) or more than an hour later ??? $suspicious_timing = $bot_trap_timestamp > time() || $bot_trap_timestamp < time() - HOUR_IN_SECONDS ? true : false; // are we human ? if ($empty_trap && !$suspicious_timing) { return; } // UH OH... $redirect_url = add_query_arg(array('ee' => 'ticket_selection_received'), EE_Registry::instance()->CFG->core->reg_page_url()); if ($suspicious_timing) { $redirect_url = add_query_arg(array('ee-notice' => urlencode(__('We\'re sorry, but your ticket selections could not be processed due to a server timing error. Please hit the back button on your browser and try again.', 'event_espresso'))), $redirect_url); } wp_safe_redirect(apply_filters('FHEE__EED_Bot_Trap__process_bot_trap__redirect_url', $redirect_url)); exit; }