Page MenuHomePhorge

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

Authored by aklapper on May 9 2023, 21:04.
Tags
None
Referenced Files
F2947290: D25210.1738455028.diff
Sat, Feb 1, 00:10
F2945408: D25210.1738315401.diff
Thu, Jan 30, 09:23
F2943123: D25210.1738165830.diff
Tue, Jan 28, 15:50
F2937404: D25210.1737957650.diff
Sun, Jan 26, 06:00
F2935614: D25210.1737858776.diff
Sat, Jan 25, 02:32
F2935613: D25210.1737858775.diff
Sat, Jan 25, 02:32
F2935611: D25210.1737858773.diff
Sat, Jan 25, 02:32
F2935610: D25210.1737858772.diff
Sat, Jan 25, 02:32

Details

Summary

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

Repository
rP Phorge
Branch
verifyOwnNewEmailAd (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 387
Build 387: arc lint + arc unit

Event Timeline

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

Thanks

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

src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php
175

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.May 19 2023, 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

lgtm

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