Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated #2959

Closed
peti123x opened this issue Sep 29, 2023 · 2 comments · Fixed by #2962
Closed

Comments

@peti123x
Copy link

Problem description

Using the latest PHP8.2 image and the latest version of phpmailer (6.8.1), I'm getting a deprecation warning pointing to https://github.com/PHPMailer/PHPMailer/blob/master/src/PHPMailer.php#L1574 (the trim() function gets a null value).

Code to reproduce

Not sure what in the system is actually making the deprecation warning emit, but nevertheless the fact that the warning appears means the trimmed value can be null.

Debug output

@Synchro
Copy link
Member

Synchro commented Sep 29, 2023

This is a little mysterious because all of From, Sender, and ConfirmReadingTo are initialised to empty strings, and nowhere are any of them set to null. However, they are public properties that can be set to null by calling code, which I assume is what's happening for you. I'm not too concerned about that, but I'll accept a PR if you want to catch that scenario.

@Synchro
Copy link
Member

Synchro commented Oct 2, 2023

This is fixed in the main branch and will be in the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants