Plugin Directory

Changeset 2616751


Ignore:
Timestamp:
10/19/2021 06:48:48 PM (4 years ago)
Author:
wordable
Message:

6.1.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wordable/trunk/wordable.php

    r2616746 r2616751  
    1111 */
    1212
    13 define('WORDABLE_VERSION', '6.1.1');
     13define('WORDABLE_VERSION', '6.1.2');
    1414add_action('admin_notices', 'wordable_admin_notices');
    1515
     
    347347
    348348    list($algo, $hash) = explode('=', $_SERVER['HTTP_X_WORDABLE_SIGNATURE'], 2) + array( '', '' );
     349
    349350    $raw_post = file_get_contents('php://input');
     351
    350352    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        }
    352358    }
    353359
     
    389395    $destination_remote_id = wordable_secret();
    390396    $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']);
    407398}
    408399
Note: See TracChangeset for help on using the changeset viewer.