configHandler = $configHandler; } /** * @inheritdoc */ public function handleAction() { $nonce = filter_input(INPUT_GET, 'nonce', FILTER_SANITIZE_STRING); if (!$nonce || false === wp_verify_nonce($nonce, self::ACTION_ID)) { $this->throwError(__( 'Invalid nonce specified', AID_CF7CR_TEXTDOMAIN)); } $apiClientId = filter_input(INPUT_GET, 'aid-cf7cr-api-client-id', FILTER_SANITIZE_STRING); $apiClientSecret = filter_input(INPUT_GET, 'aid-cf7cr-api-client-secret', FILTER_SANITIZE_STRING); $apiToken = filter_input(INPUT_GET, 'aid-cf7cr-api-token', FILTER_SANITIZE_STRING); $redirectionTarget = filter_input(INPUT_GET, 'target', FILTER_SANITIZE_URL); $token = $this->configHandler->getApiToken(); $token->setAccessToken($apiToken); $this->configHandler->setApiClientId($apiClientId); $this->configHandler->setApiClientSecret($apiClientSecret); $this->configHandler->setApiToken($token); wp_safe_redirect(admin_url($redirectionTarget)); exit(); } }