From e23ce321766411d650528f0ab553356a11c2e526 Mon Sep 17 00:00:00 2001 From: Al Ganiev Date: Tue, 7 Sep 2021 12:55:29 +1000 Subject: [PATCH] Fix supressions method --- src/LEFunctions.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/LEFunctions.php b/src/LEFunctions.php index cfbf44b..fb729ee 100644 --- a/src/LEFunctions.php +++ b/src/LEFunctions.php @@ -84,7 +84,10 @@ public static function RSAGenerateKeys($directory, $privateKeyFile = 'private.pe file_put_contents($privateKeyFile, $privateKey); file_put_contents($publicKeyFile, $details['key']); - openssl_pkey_free($res); + if (version_compare(PHP_VERSION, '8.0', '<')) { + openssl_pkey_free($res); + } + } /** @@ -129,7 +132,9 @@ public static function ECGenerateKeys($directory, $privateKeyFile = 'private.pem file_put_contents($privateKeyFile, $privateKey); file_put_contents($publicKeyFile, $details['key']); - openssl_pkey_free($res); + if (version_compare(PHP_VERSION, '8.0', '<')) { + openssl_pkey_free($res); + } } @@ -208,7 +213,7 @@ public static function checkHTTPChallenge($domain, $token, $keyAuthorization) curl_setopt($handle, CURLOPT_URL, $requestURL); curl_setopt($handle, CURLOPT_RETURNTRANSFER, true); curl_setopt($handle, CURLOPT_FOLLOWLOCATION, true); - curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false); $response = trim(curl_exec($handle)); return (!empty($response) && $response == $keyAuthorization); @@ -232,7 +237,7 @@ public static function checkDNSChallenge($domain, $DNSDigest) $response = json_decode(trim(curl_exec($handle))); if($response->Status === 0 && isset($response->Answer)) { - foreach($response->Answer as $answer) + foreach($response->Answer as $answer) { if($answer->type === 16) {