MicahCarrick / PHP-PayPal-IPN

PHP 5 class to listen for and handle Instant Payment Notifications (IPN) from PayPal.
BSD 3-Clause "New" or "Revised" License
418 stars 252 forks source link

improvement FIX SSL #23

Open justvanbloom opened 11 years ago

justvanbloom commented 11 years ago

replace this: $fp = fsockopen($url_parsed[host],"80",$err_num,$err_str,30); with: if ($url_parsed['scheme'] == 'https') { $url_parsed['port'] = 443;
$ssl = 'ssl://'; } else { $url_parsed['port'] = 80; $ssl = ''; } $fp = @fsockopen($ssl.$url_parsed['host'], $url_parsed['port'], $err_num, $err_str, 30);