Page MenuHomePhorge

Fix PHP 8.1 "strlen(null)" exception which blocks rendering Conduit's dashboard.panel.edit page
ClosedPublic

Authored by aklapper on May 29 2023, 11:18.
Tags
None
Referenced Files
F3857701: D25257.1746167335.diff
Thu, May 1, 06:28
F3852377: D25257.1746123784.diff
Wed, Apr 30, 18:23
F3851251: D25257.1746115979.diff
Wed, Apr 30, 16:12
F3766720: D25257.1745846504.diff
Sun, Apr 27, 13:21
F3657417: D25257.1745446254.diff
Tue, Apr 22, 22:10
F3578362: D25257.1745093283.diff
Fri, Apr 18, 20:08
F3469861: D25257.1744745269.diff
Mon, Apr 14, 19:27
F3389606: D25257.1744459450.diff
Fri, Apr 11, 12:04

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 T15425

Test Plan

Applied this change; afterwards /conduit/method/dashboard.panel.edit/ correctly renders in browser.

Diff Detail

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

Event Timeline

Thaanks

I visited every single Conduit API .edit page and I was able to see that every page has a documentation type = NULL, but /conduit/method/owners.edit/ has a nice raw Remarkup string for example. Really no other thing.

So, phutil_nonempty_string() will report alien types, and that is good here.

sgtm

Hoping to be useful I will add a small inline documentation to help future people

This revision is now accepted and ready to land.May 29 2023, 21:03