Changeset 2616751
- Timestamp:
- 10/19/2021 06:48:48 PM (4 years ago)
- File:
-
- 1 edited
-
wordable/trunk/wordable.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wordable/trunk/wordable.php
r2616746 r2616751 11 11 */ 12 12 13 define('WORDABLE_VERSION', '6.1. 1');13 define('WORDABLE_VERSION', '6.1.2'); 14 14 add_action('admin_notices', 'wordable_admin_notices'); 15 15 … … 347 347 348 348 list($algo, $hash) = explode('=', $_SERVER['HTTP_X_WORDABLE_SIGNATURE'], 2) + array( '', '' ); 349 349 350 $raw_post = file_get_contents('php://input'); 351 350 352 if (strlen($raw_post) == 0) { 351 $raw_post = file_get_contents($_FILES['file']['tmp_name']); 353 try { 354 $raw_post = file_get_contents($_FILES['file']['tmp_name']); 355 } catch(Throwable $e) { 356 $raw_post = ''; 357 } 352 358 } 353 359 … … 389 395 $destination_remote_id = wordable_secret(); 390 396 $url = wordable_api_url("/wordpress/connection_check?destination[remote_id]={$destination_remote_id}"); 391 392 $curl = curl_init($url); 393 curl_setopt($curl, CURLOPT_URL, $url); 394 curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); 395 396 $headers = array( 397 "Accept: application/json", 398 ); 399 curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); 400 curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); 401 curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); 402 403 $response = json_decode(curl_exec($curl)); 404 curl_close($curl); 405 406 return $response; 397 return json_decode(wp_remote_get($url)['body']); 407 398 } 408 399
Note: See TracChangeset
for help on using the changeset viewer.