Page MenuHomePhorge

PHP 8.1: fixes for strlen() not accepting NULL anymore, part 2
ClosedPublic

Authored by valerio.bozzolan on Apr 1 2023, 09:40.
Tags
None
Referenced Files
F2173830: D25105.diff
Wed, May 1, 23:13
Unknown Object (File)
Sat, Apr 13, 20:42
Unknown Object (File)
Sat, Apr 13, 09:48
Unknown Object (File)
Sat, Apr 13, 07:34
Unknown Object (File)
Fri, Apr 12, 18:28
Unknown Object (File)
Thu, Apr 11, 19:18
Unknown Object (File)
Sun, Apr 7, 06:15
Unknown Object (File)
Apr 1 2024, 01:06

Details

Summary

This is a fix for PHP 8.1 deprecation of strlen(NULL), for these Phorge components:

  • scripts
  • aphront
  • project

The strlen() was used in Phabricator to check if a generic value was a non-empty string.
For this reason, Phorge adopts phutil_nonempty_string() that checks that.

Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If your phutil_nonempty_string() throws an exception, just
report it to Phorge to evaluate and fix together that specific corner case.

Closes T15223
Ref T15190
Ref T15064

Test Plan
  • check with your big eyes that there are no obvious typos

Diff Detail

Repository
rP Phorge
Branch
massive-php-escape
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 213
Build 213: arc lint + arc unit

Event Timeline

valerio.bozzolan retitled this revision from PHP 8.2: fixes for strlen() not accepting NULL anymore, part 2 to PHP 8.1: fixes for strlen() not accepting NULL anymore, part 2.Apr 1 2023, 13:06
valerio.bozzolan edited the summary of this revision. (Show Details)
valerio.bozzolan edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Apr 1 2023, 13:11