Plugin Directory

Changeset 809240


Ignore:
Timestamp:
11/23/2013 10:18:49 AM (12 years ago)
Author:
pntrinh
Message:

fix method

Location:
tr-cache-and-security/trunk/inc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tr-cache-and-security/trunk/inc/tr_security_class.php

    r808562 r809240  
    3434        $u = @base64_encode($u);
    3535        $for = str_replace(array('http://','https://'),'',get_bloginfo('url'));
     36        $body = array();
    3637        $body['tr_action'] = 'get_lock_ip_remote';
    3738        $body['ip'] = $ip;
     
    4142        $body['u']  = $u;
    4243        $body['s']  = $s;
    43         $rs = wp_remote_post(TRSCSC_SERVER, array('body' => $body,
    44                 'timeout' => 3));
    45 
     44        $rs = wp_remote_get(TRSCSC_SERVER.'?'.http_build_query($body), array('timeout' => 3));
     45       
    4646        $return = false;
    4747        if (!is_wp_error($rs)) {
  • tr-cache-and-security/trunk/inc/trcs_cache-options.php

    r808562 r809240  
    136136
    137137///
    138 
    139 if(!isset($_SESSION['tr_security']) || @$_SESSION['tr_security']<time()-86400)
     138$logged = isset($_SESSION['tr_security']) && @$_SESSION['tr_security']>time()-86400;
     139if($logged && get_option('_tr_sc_logged_server'))
    140140{
    141141    $body = array();
     
    143143    $body['getdata'] = 'cache-security';
    144144    $body['for']     = urlencode($for);
    145     $data = @wp_remote_post(TRSCSC_SERVER,array('body'=>$body));
     145    $data = @wp_remote_get(TRSCSC_SERVER.'?'.http_build_query($body),array('timeout' => 3));
    146146    $data = @json_decode($data,true);
    147     if(is_array($data))
     147    if(is_array($data) && $data['ok'])
    148148    {
    149149        $fname = @$data['tr_security'];
     150        update_option('_tr_sc_logged_server',true);
    150151    }
    151152}
Note: See TracChangeset for help on using the changeset viewer.