From 8f4c08aec9b749f10b9fd8abaa3e9df20c9e0e42 Mon Sep 17 00:00:00 2001 From: Bobby Kostadinov Date: Mon, 4 Feb 2013 14:52:27 +0000 Subject: [PATCH] Check if cURL is available Add a simple check to make sure cURL is available before using it. If not, teh scritp would use the fsockopen --- ipnlistener.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ipnlistener.php b/ipnlistener.php index bb8c93d..4196215 100644 --- a/ipnlistener.php +++ b/ipnlistener.php @@ -15,8 +15,8 @@ class IpnListener { /** - * If true, the recommended cURL PHP library is used to send the post back - * to PayPal. If flase then fsockopen() is used. Default true. + * If true, the recommended cURL PHP library is usedto send the post back + * to PayPal. If flase or curl is not available then fsockopen() is used. Default true. * * @var boolean */ @@ -279,7 +279,7 @@ public function processIpn($post_data=null) { } } - if ($this->use_curl) $this->curlPost($encoded_data); + if ($this->use_curl && function_exists('curl_version')) $this->curlPost($encoded_data); else $this->fsockPost($encoded_data); if (strpos($this->response_status, '200') === false) {