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
F3605484: D25105.1745272529.diff
Sun, Apr 20, 21:55
F3605178: D25105.1745255821.diff
Sun, Apr 20, 17:17
F3604958: D25105.1745246834.diff
Sun, Apr 20, 14:47
F3529726: D25105.1744863652.diff
Wed, Apr 16, 04:20
F3527276: D25105.1744837330.diff
Tue, Apr 15, 21:02
F3489642: D25105.1744782300.diff
Tue, Apr 15, 05:45
F3400556: D25105.1744557127.diff
Sat, Apr 12, 15:12
F3398595: D25105.1744539588.diff
Sat, Apr 12, 10:19

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