Page MenuHomePhorge

Fix PHP 8.1 "strlen(null)" exception from ArcanistRefView which blocks "arc look remotes"
ClosedPublic

Authored by valerio.bozzolan on May 8 2023, 17:04.
Tags
None
Referenced Files
F3179003: D25206.1741314013.diff
Thu, Mar 6, 02:20
F3001291: D25206.1740441518.diff
Sun, Feb 23, 23:58
F3001290: D25206.1740441517.diff
Sun, Feb 23, 23:58
F2992399: D25206.1740212939.diff
Fri, Feb 21, 08:28
F2988383: D25206.1740150049.diff
Thu, Feb 20, 15:00
F2983584: D25206.1739992061.diff
Tue, Feb 18, 19:07
F2962409: D25206.1739179632.diff
Sun, Feb 9, 09:27
F2962408: D25206.1739179626.diff
Sun, Feb 9, 09:27

Details

Summary

This change fixes the command arc look remotes for PHP 8.1.

Without this change, the null value bubbles up to PhutilUTF8StringTruncator, reaching a strlen().

This control probably does not need to be done at this low level inside PhutilUTF8StringTruncator,
but it is right to be at this high level from the caller in ArcanistRefView.

Closes T15368

Test Plan
  • run "arc look remotes"
  • still works in "old PHP" like 7.4
  • start to work in recent PHP 8.1+

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

src/ref/ArcanistRefView.php
103

↑ here the problematic area - this should not receive null

Hi @Matthew :D super-safe thing here. Do you love this?

I think @speck maybe has better approaches here (do you know arc look? it's lovely)

This revision is now accepted and ready to land.Jun 1 2023, 15:38