← All changes
|
includes/Core/Integration/ZohoMail/ZohoMailHandler.php
+3
-15
3.2.2
→
2.15.3
View file →
| @@ -6,16 +6,11 @@ | ||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | namespace BitCode\BitForm\Core\Integration\ZohoMail; |
| 9 | 9 | |
| 10 | -if (!defined('ABSPATH')) { | |
| 11 | - exit; | |
| 12 | -} | |
| 13 | - | |
| 14 | 10 | use BitCode\BitForm\Core\Integration\IntegrationHandler; |
| 15 | 11 | use BitCode\BitForm\Core\Util\HttpHelper; |
| 16 | 12 | use BitCode\BitForm\Core\Util\IpTool; |
| 17 | -use BitCode\BitForm\GlobalHelper; | |
| 18 | 13 | use WP_Error; |
| 19 | 14 | |
| 20 | 15 | /** |
| 21 | 16 | * Provide functionality for ZohoCrm integration |
| @@ -50,19 +45,12 @@ | ||
| 50 | 45 | * @return JSON zoho crm api response and status |
| 51 | 46 | */ |
| 52 | 47 | public static function generateTokens() |
| 53 | 48 | { |
| 54 | - if (isset($_REQUEST['_ajax_nonce']) && wp_verify_nonce(sanitize_text_field(wp_unslash($_REQUEST['_ajax_nonce'])), 'bitforms_save')) { | |
| 49 | + if (isset($_REQUEST['_ajax_nonce']) && wp_verify_nonce($_REQUEST['_ajax_nonce'], 'bitforms_save')) { | |
| 55 | 50 | $authorizationHeader = null; |
| 56 | - | |
| 57 | - GlobalHelper::requirePostMethod(); | |
| 58 | - | |
| 59 | - try { | |
| 60 | - $requestsParams = GlobalHelper::formatRequestData(); | |
| 61 | - } catch (\InvalidArgumentException $e) { | |
| 62 | - wp_send_json_error($e->getMessage(), 400); | |
| 63 | - } | |
| 64 | - | |
| 51 | + $inputJSON = file_get_contents('php://input'); | |
| 52 | + $requestsParams = json_decode($inputJSON); | |
| 65 | 53 | if ( |
| 66 | 54 | empty($requestsParams->{'accounts-server'}) |
| 67 | 55 | || empty($requestsParams->dataCenter) |
| 68 | 56 | || empty($requestsParams->clientId) |