1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 14:00:56 +01:00
phorge-phorge/src/view
Andre Klapper d8d65f3f87 Fix PHP 8.1 "strlen(null)" exception on UIExamples' Bars page
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.

```
EXCEPTION: (RuntimeException) strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
arcanist(head=master, ref.master=b325304b6e52), phorge(head=uiExamples, ref.master=dd24c94b0741, ref.uiExamples=dd24c94b0741)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/view/phui/PHUISegmentBarSegmentView.php:58]
```

Closes T15441

Test Plan:
After applying this change, going to `/uiexample/view/PhabricatorAphrontBarUIExample/`,"Bars (PhabricatorAphrontBarUIExample)" renders with beautiful colors.

To see that page, enable prototypes with:

    ./bin/config set phabricator.show-prototypes true

Also try to create a Milestone on a Project, with the Config `maniphest.points` enabled, and try to create some Tasks with different points. Visit its Workboard to see the bar that still works with a useful tooltip.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

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

Maniphest Tasks: T15441

Differential Revision: https://we.phorge.it/D25272
2023-06-03 11:50:52 +02:00
..
__tests__ Fix local time test case for logged-out viewers using global settings 2016-11-28 09:27:11 -08:00
control Correct spelling mistakes 2023-05-27 22:19:06 +01:00
extension Introduce "Curtain" views, panels, and extensions 2016-03-06 09:27:55 -08:00
form AphrontFormControl: fix regression for some specific Captions 2023-05-19 22:17:36 +02:00
formation Stick the page footer in the right place on Formation View pages 2020-04-24 11:25:31 -07:00
fuel Improve handle/status list display on devices in commit graph lists 2020-08-12 09:04:08 -07:00
layout Fix PHP 8.1 "strlen(null)" exceptions which block rendering the People page 2023-05-01 22:31:28 +02:00
page Fix numerous PHP 8.1 "strlen(null)" exceptions preventing homepage to display 2023-04-27 14:08:48 +02:00
phui Fix PHP 8.1 "strlen(null)" exception on UIExamples' Bars page 2023-06-03 11:50:52 +02:00
widget Merge a small amount of remaining "libphutil/" code with Phabricator, break libphutil dependency 2020-02-12 15:17:36 -08:00
AphrontAutoIDView.php Add a "FormationView" to support dynamic flank panels 2020-04-22 08:23:21 -07:00
AphrontDialogView.php Members page of Parent Subproject: less dead-end 2023-04-25 20:53:44 +02:00
AphrontJavelinView.php Various linter fixes 2015-05-20 07:27:41 +10:00
AphrontNullView.php Provide hasChildren() to replace isEmptyContent() 2013-08-12 07:51:01 -07:00
AphrontTagView.php Remove extra container tag on HandleListViews rendering from ModularTransactions in text mode 2017-01-09 08:41:59 -08:00
AphrontView.php Fix spelling 2017-10-09 10:48:04 -07:00
viewutils.php When printing timestamps on paper: use an absolute, context-free date format 2020-09-04 16:36:34 -07:00