1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 16:22:43 +01:00

PHPMailer: Set defaults for required parameters followed by optional parameters in Authorise() method signature

Summary:
Required parameters $password and $username follow the optional parameter $tval.
This is deprecated since PHP 8.0 per https://www.php.net/manual/en/migration80.deprecated.php
Define defaults for those required parameters to fix the issue - https://github.com/PHPMailer/PHPMailer/blob/master/src/POP3.php#L199 seems to also have survived so far without complaints by PHP 8 users (and PHPStan also does not complain anymore after this change).

Closes T15834

Test Plan: Carefully read the code.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15834

Differential Revision: https://we.phorge.it/D25660
This commit is contained in:
Andre Klapper 2024-05-30 15:38:57 +02:00
parent 4bf5c452eb
commit d9e543ba97

View file

@ -142,7 +142,7 @@ class POP3 {
* @param string $username * @param string $username
* @param string $password * @param string $password
*/ */
public function Authorise ($host, $port = false, $tval = false, $username, $password, $debug_level = 0) { public function Authorise ($host, $port = false, $tval = false, $username = '', $password = '', $debug_level = 0) {
$this->host = $host; $this->host = $host;
// If no port value is passed, retrieve it // If no port value is passed, retrieve it