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
F2946882: D25206.1738425751.diff
Fri, Jan 31, 16:02
F2946866: D25206.1738424997.diff
Fri, Jan 31, 15:49
F2946749: D25206.1738413978.diff
Fri, Jan 31, 12:46
F2945392: D25206.1738314044.diff
Thu, Jan 30, 09:00
F2944000: D25206.1738235587.diff
Wed, Jan 29, 11:13
F2942952: D25206.1738149498.diff
Tue, Jan 28, 11:18
F2942844: D25206.1738141061.diff
Tue, Jan 28, 08:57
F2936103: D25206.1737900582.diff
Sat, Jan 25, 14:09

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
Branch
fix-look-remotes-2
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 382
Build 382: arc lint + arc unit

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