From 4a843008394aaaf414107051869c2e152b34c3a2 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 19 Nov 2024 23:50:45 +0100 Subject: [PATCH] fixed lib to work with php8.3 --- lib/Pear/Mail/Mail.php | 2 +- lib/Pear/Mail/Mail/smtp.php | 4 +++- lib/Pear/Mail/mime.php | 4 ++-- lib/Pear/PEAR.php | 13 ++++--------- lib/mailcannon.php | 2 +- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/lib/Pear/Mail/Mail.php b/lib/Pear/Mail/Mail.php index 4858f3f..222cf70 100644 --- a/lib/Pear/Mail/Mail.php +++ b/lib/Pear/Mail/Mail.php @@ -153,7 +153,7 @@ class Mail foreach ($headers as $key => $value) { $headers[$key] = preg_replace('=((||0x0A/%0A|0x0D/%0D|\\n|\\r)\S).*=i', - null, $value); + '', $value); } } diff --git a/lib/Pear/Mail/Mail/smtp.php b/lib/Pear/Mail/Mail/smtp.php index 511a803..cfbc58b 100644 --- a/lib/Pear/Mail/Mail/smtp.php +++ b/lib/Pear/Mail/Mail/smtp.php @@ -178,6 +178,8 @@ class Mail_smtp extends Mail { */ var $socket_options = array(); + var $queued_as = null; + var $greeting = null; /** * Constructor. * @@ -305,7 +307,7 @@ class Mail_smtp extends Mail { $params .= ' ' . $key . (is_null($val) ? '' : '=' . $val); } } - if (PEAR::isError($res = $this->_smtp->mailFrom($from, ltrim($params)))) { + if (PEAR::isError($res = $this->_smtp->mailFrom($from, ltrim($params ?? '')))) { $error = $this->_error("Failed to set sender: $from", $res); $this->_smtp->rset(); return PEAR::raiseError($error, PEAR_MAIL_SMTP_ERROR_SENDER); diff --git a/lib/Pear/Mail/mime.php b/lib/Pear/Mail/mime.php index c3da7bb..2e8c08b 100644 --- a/lib/Pear/Mail/mime.php +++ b/lib/Pear/Mail/mime.php @@ -899,7 +899,7 @@ class Mail_mime $attachments = count($this->parts) > 0; $html_images = count($this->html_images) > 0; $html = strlen($this->htmlbody) > 0; - $calendar = strlen($this->calbody) > 0; + $calendar = strlen($this->calbody ?? '') > 0; $has_text = strlen($this->txtbody) > 0; $text = !$html && $has_text; $mixed_params = array('preamble' => $this->build_params['preamble']); @@ -1372,7 +1372,7 @@ class Mail_mime $attachments = count($this->parts) > 0; $html_images = count($this->html_images) > 0; $html = strlen($this->htmlbody) > 0; - $calendar = strlen($this->calbody) > 0; + $calendar = strlen($this->calbody ?? '') > 0; $has_text = strlen($this->txtbody) > 0; $text = !$html && $has_text; $headers = array(); diff --git a/lib/Pear/PEAR.php b/lib/Pear/PEAR.php index 144665c..78b332c 100644 --- a/lib/Pear/PEAR.php +++ b/lib/Pear/PEAR.php @@ -1,7 +1,4 @@ ", - base_convert(microtime(), 10, 36), + base_convert(preg_replace( '/[^0-9]/', '', microtime()), 10, 36), base_convert(bin2hex(openssl_random_pseudo_bytes(8)), 16, 36), $domain );