Page MenuHomePhorge

Fix some PHP 8.1 "strlen(null)" exceptions which block rendering a project page
ClosedPublic

Authored by aklapper on Apr 30 2023, 18:40.

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 T15313

Test Plan

Applied these three changes (with D25144, D25145, D25146, D25147, D25151,
D25152, D25153 on top).
Afterwards end up with the unresolved exception covered by T15263.

Diff Detail

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

Event Timeline

Thanks again

Tested locally. No implosions.

sgtm

src/applications/project/state/PhabricatorWorkboardViewState.php
44

✅ I tested this locally with phlog() and $request->getURIData('queryKey') assumes values like "all" or other strings, or null.

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

172

✅ I tested this locally with phlog() and $request_query assumes values like "EoH3rp0DnRFW" or other search keys, or null.

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

206

✅ I tested this locally with phlog() and $default_query assumes values like "all" or other strings, or null.

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

This revision is now accepted and ready to land.May 1 2023, 20:21