Page MenuHomePhorge

Fix PHP 8.1 "ltrim(null)" exception which blocks adding additional user email address

Authored by aklapper on Tue, May 9, 21:04.
Referenced Files
Unknown Object (File)
Sun, Jun 4, 04:06
Unknown Object (File)
Sat, Jun 3, 09:08
Unknown Object (File)
Fri, Jun 2, 20:50
Unknown Object (File)
Fri, Jun 2, 20:31
Unknown Object (File)
Fri, Jun 2, 11:58
Unknown Object (File)
Wed, May 31, 06:41
Unknown Object (File)
Mon, May 29, 18:32



Since PHP 8.1, passing a null string to ltrim(string $string) is deprecated.

Thus we make sure that $request->getStr('email') does not return null as default.

Closes T15376

Test Plan

Applied this change, afterwards repeated the steps to add a new email address on /settings/panel/email/. This time, it's possible to close the "Verification Email Sent" and the page /settings/panel/email/ renders and lists the new email address.

Diff Detail

rP Phorge
Lint Not Applicable
Tests Not Applicable

Event Timeline

aklapper requested review of this revision.Tue, May 9, 21:04


Please see my inline comment, probably just adding 3 characters fixes, and that would be probably the approach from O1

I accept as behalf of myself in the meanwhile, thanks


Probably the exact minimal fix is just that.

Kind of "don't care" logic.

Yep I confirm my opinion here, let's ping-pong this tomorrow

This revision now requires changes to proceed.Fri, May 19, 23:03

(it works indeed, so no need from me to red block)

valerio.bozzolan edited the summary of this revision. (Show Details)

Thanks again :)

I tested this locally following the test plan without any nuclear implosion. Green light from me


This revision is now accepted and ready to land.Sat, May 20, 12:03