WordPress.org

Plugin Directory


Ignore:
Timestamp:
02/08/13 23:54:35 (14 months ago)
Author:
liedekef
Message:

make paypal work via https and HTTP/1.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • events-made-easy/trunk/paypal/IPN.php

    r460003 r665436  
    133133 
    134134        // connect to paypal 
    135         $socket = fsockopen($url_parsed['host'],80,$err_num,$err_str,30); 
     135        $socket = fsockopen("ssl://".$url_parsed['host'],443,$err_num,$err_str,30); 
    136136 
    137137        if(!$socket) { 
     
    144144            // connected, add the ipn validation cmd and post everything back to PayPal 
    145145            $req = 'cmd=_notify-validate' . $req; 
    146             $header .= "POST ".$url_parsed['path']." HTTP/1.0\r\n"; 
     146            $header = "POST ".$url_parsed['path']." HTTP/1.1\r\n"; 
     147            $header .= "Host: ".$url_parsed['host']."\r\n"; 
     148            $header .= "Connection: close\r\n"; 
    147149            $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; 
    148150            $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; 
Note: See TracChangeset for help on using the changeset viewer.