Page MenuHomePhorge

Fix PHP 8.1 "strlen(null)" exception which blocks loading icons when creating new Diffusion repository
ClosedPublic

Authored by aklapper on Apr 30 2023, 08:38.

Details

Summary

strlen() was used in Phabricator to check if a generic value is a non-empty string.
This behavior is deprecated since PHP 8.1. Phorge adopts phutil_nonempty_string() as a replacement.

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

Closes T15301

Test Plan

Applied this change (on top of D25150) and icons rendered in web browser.

Diff Detail

Repository
rP Phorge
Branch
D25151 (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 297
Build 297: arc lint + arc unit

Event Timeline

Thanks for this fix

Tested locally with / without HTTP Range playing an audio file.

sgtm

src/applications/files/controller/PhabricatorFileDataController.php
72

✅ The HTTP range assumes string values like "bytes=0-" etc. and null but not other things.

The phutil_nonempty_string() will report alien values and that is OK.

This revision is now accepted and ready to land.May 1 2023, 18:47