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
F3005268: D25105.1740515924.diff
Mon, Feb 24, 20:38
F3005151: D25105.1740510804.diff
Mon, Feb 24, 19:13
F3005150: D25105.1740510801.diff
Mon, Feb 24, 19:13
F3005149: D25105.1740510799.diff
Mon, Feb 24, 19:13
F2996607: D25105.1740382362.diff
Sun, Feb 23, 07:32
F2981813: D25105.1739937072.diff
Tue, Feb 18, 03:51
F2963512: D25105.1739215296.diff
Sun, Feb 9, 19:21
F2963511: D25105.1739215292.diff
Sun, Feb 9, 19:21

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