Page MenuHomePhorge

Fix a PHP 8.1/8.2 deprecated call to strlen with a NULL argument

Authored by bob on Aug 9 2023, 16:07.
Referenced Files
Unknown Object (File)
Sun, Feb 25, 06:44
Unknown Object (File)
Sat, Feb 24, 06:16
Unknown Object (File)
Sat, Feb 24, 04:15
Unknown Object (File)
Sat, Feb 24, 03:33
Unknown Object (File)
Mon, Feb 19, 15:25
Unknown Object (File)
Jan 27 2024, 21:26
Unknown Object (File)
Jan 26 2024, 14:19
Unknown Object (File)
Jan 25 2024, 04:15



This call was preventing notification servers configuration to be properly initialized.
Indeed, strlen() was used in Phabricator to check if a generic value is a non-empty string.
This behavior is deprecated since PHP 8.1. Phorge adopts phutil_nonempty_string() as a replacement.

Fix T15596

Test Plan

Sign in as an administrator, configure the notification server without filling admin path field,
you shouldn't get an invalid configuration error

Diff Detail

rP Phorge
Lint Not Applicable
Tests Not Applicable

Event Timeline

bob requested review of this revision.Aug 9 2023, 16:07

Thanks bob, ready for land

Indeed NULL must be an allowed value, since this check was designed to exactly look for a non-existence of that. Indeed the only allowed value must be a string.

Any other alien value will cause our lovely-super-mega-implosion, and we like that.



↑ interestingly the path MUST be a string, or NULL, or nothing else, so indeed the change looks good to me.

This revision is now accepted and ready to land.Aug 10 2023, 08:10

Perfect ! Thanks for the review valerio !

Would you like to try yourself arc patch D25381 and then arc land to land into master branch?