From 5465e073a21fb4b3f6678b410308c6947338aa00 Mon Sep 17 00:00:00 2001 From: kit rio Date: Tue, 31 May 2022 15:02:53 +0900 Subject: [PATCH] =?UTF-8?q?PHP=208.1=20deprecated=20openssl=5Fpkey=5Ffree?= =?UTF-8?q?=20=ED=95=A8=EC=88=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 8.1부터는 자동으로 메모리에서 해제가 되게 바뀌어서 8이하에서만 작동되게 수정. --- plugin/PHPMailer/class.phpmailer.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plugin/PHPMailer/class.phpmailer.php b/plugin/PHPMailer/class.phpmailer.php index abb679614..79e699706 100644 --- a/plugin/PHPMailer/class.phpmailer.php +++ b/plugin/PHPMailer/class.phpmailer.php @@ -3818,7 +3818,9 @@ class PHPMailer if (version_compare(PHP_VERSION, '5.3.0') >= 0 and in_array('sha256WithRSAEncryption', openssl_get_md_methods(true))) { if (openssl_sign($signHeader, $signature, $privKey, 'sha256WithRSAEncryption')) { - openssl_pkey_free($privKey); + if (PHP_MAJOR_VERSION < 8) { + openssl_pkey_free($privKey); + } return base64_encode($signature); } } else { @@ -3831,11 +3833,15 @@ class PHPMailer $eb = pack('H*', '0001' . str_repeat('FF', $pslen) . '00' . $t); if (openssl_private_encrypt($eb, $signature, $privKey, OPENSSL_NO_PADDING)) { - openssl_pkey_free($privKey); + if (PHP_MAJOR_VERSION < 8) { + openssl_pkey_free($privKey); + } return base64_encode($signature); } } - openssl_pkey_free($privKey); + if (PHP_MAJOR_VERSION < 8) { + openssl_pkey_free($privKey); + } return ''; }