fixes #1939 update phpmailer from 6.5.1 to 6.8.0 (PHP 8.2 compatibility)

This commit is contained in:
plegall
2023-08-02 12:46:34 +02:00
parent a9fbb3546c
commit da559de7aa
6 changed files with 494 additions and 77 deletions
+21 -2
View File
@@ -46,7 +46,7 @@ class POP3
*
* @var string
*/
const VERSION = '6.5.1';
const VERSION = '6.8.0';
/**
* Default POP3 port number.
@@ -308,6 +308,7 @@ class POP3
{
if (!$this->connected) {
$this->setError('Not connected to POP3 server');
return false;
}
if (empty($username)) {
$username = $this->username;
@@ -336,7 +337,21 @@ class POP3
*/
public function disconnect()
{
$this->sendString('QUIT');
// If could not connect at all, no need to disconnect
if ($this->pop_conn === false) {
return;
}
$this->sendString('QUIT' . static::LE);
// RFC 1939 shows POP3 server sending a +OK response to the QUIT command.
// Try to get it. Ignore any failures here.
try {
$this->getResponse();
} catch (Exception $e) {
//Do nothing
}
//The QUIT command may cause the daemon to exit, which will kill our connection
//So ignore errors here
try {
@@ -344,6 +359,10 @@ class POP3
} catch (Exception $e) {
//Do nothing
}
// Clean up attributes.
$this->connected = false;
$this->pop_conn = false;
}
/**