HomePhorge

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

Description

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

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

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: speck, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15223, T15190, T15064

Differential Revision: https://we.phorge.it/D25105

Details

Provenance
Valerio BozzolanAuthored on Apr 1 2023, 6:19 AM
themackabuPushed on Tue, Mar 25, 8:07 PM
Parents
rPd25d630fe5dd: PHP 8.2: fixes for strlen() not accepting NULL anymore, part 1
Branches
Unknown
Tags
Unknown

Event Timeline