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
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
F3392481: D25105.1744488085.diff
Fri, Apr 11, 20:01
F3377474: D25105.1744340944.diff
Thu, Apr 10, 03:09

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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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