HomePhorge

Fix regression in PHUIObjectItemView.php:662: allow PhutilURI and other…

Description

Fix regression in PHUIObjectItemView.php:662: allow PhutilURI and other stringlike

Summary:
This fixes this specific exception that can happen with whatever PHP version in some pages:

Call to phutil_nonempty_string() expected null or a string, got: PhutilURI from PHUIObjectItemView.php:662

The regression was introduced since:

b56d86e48d0f63028cb5739c179d61ece2a24bb1

The problem is caused by the fact that we are trying to introduce very strict checks, and sometime we are too much strict.

In this specific case we use phutil_nonempty_stringlike() since it also allows objects with a __toString() method.

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

If you see this log line, report it in the respective Task. Thank you!

Closes T15306
Ref T15316

Test Plan:

  1. DashboardAdd a Panel: no crash
  2. Diffusion repoREADME: no crash
  3. HeraldCreate: no crash

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: avivey, aklapper, speck, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15306, T15316

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

Details

Provenance
Valerio BozzolanAuthored on May 6 2023, 6:55 AM
themackabuPushed on Mar 25 2025, 8:07 PM
Parents
rP651e3f7263b5: Fix PHP 8.1 "strlen(null)" exception which blocks rendering a File page when…
Branches
Loading...
Tags
Loading...

Event Timeline