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
F3305159: D25257.1743111337.diff
Wed, Mar 26, 21:35
F3296504: D25257.1742973949.diff
Tue, Mar 25, 07:25
F3284189: D25257.1742769860.diff
Sat, Mar 22, 22:44
F3222062: D25257.1741901256.diff
Wed, Mar 12, 21:27
F3221118: D25257.1741813766.diff
Tue, Mar 11, 21:09
F3221117: D25257.1741813762.diff
Tue, Mar 11, 21:09
F3221116: D25257.1741813759.diff
Tue, Mar 11, 21:09
F3221115: D25257.1741813755.diff
Tue, Mar 11, 21:09

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

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