Homestyx hydra
Diffusion hydra 4d88095f2a53

Fix PHP 8.1 "strlen(null)" exception which blocks rendering the Projects page…

Description

Fix PHP 8.1 "strlen(null)" exception which blocks rendering the Projects page (and log alien values)

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 general replacement.

In this specific case we use phutil_nonempty_stringlike() since we are not sure
if the variable href should be just a string or other objects.

In order not to leave these cases to chance, we have added a log line, which can be
removed in the future.

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 T15303
Ref T15316

Test Plan:
Applied this change (on top of D25144, D25145, D25146, D25147, D25150,
D25142) and /project/ rendered in web browser.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: avivey, speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15303, T15316

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

Details

Provenance
Andre KlapperAuthored on May 1 2023, 4:22 PM
sirocylPushed on Oct 16 2024, 5:49 AM
Parents
R1:b44665aefe52: Fix PHP 8.1 "strlen(null)" exception which blocks rendering Notifications'…
Branches
Unknown
Tags
Unknown

Event Timeline