Skip to content

Commit

Permalink
Update for compatibility.
Browse files Browse the repository at this point in the history
The curl option CURLOPT_SSL_VERIFYPEER is now only sent when the PHP version is 7.1.0 or above.
  • Loading branch information
Pantoflarz committed Sep 5, 2020
1 parent e097b1d commit 97dda3c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion netspeakapi.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,7 @@ function shopVerifyPaymentInformation($payment){
}
}

//internal functions which will not be commented or explained
function send($command, $commandData = null){

$ch = curl_init();
Expand All @@ -800,7 +801,9 @@ function send($command, $commandData = null){
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
if(PHP_VERSION_ID >= 70100) {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
}
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
curl_setopt($ch, CURLOPT_HEADER, 0);
Expand Down

0 comments on commit 97dda3c

Please sign in to comment.