1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-22 12:41:19 +01:00
phorge-phorge/src/applications/repository
Andre Klapper db19b23dce Fix PHP 8.1 "strlen(null)" exceptions on History page of Diffusion repo after changing text encoding
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=97e163187418), phorge(head=master, ref.master=108cbcd09bd3)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/repository/xaction/PhabricatorRepositoryEncodingTransaction.php:20]
```

Closes T15460

Test Plan: After applying these two changes, changing the text encoding of a Diffusion repository to a valid encoding and going to `/diffusion/1/manage/history/`, page renders correctly and shows no exception.

Reviewers: O1 Blessed Committers, speck

Reviewed By: O1 Blessed Committers, speck

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

Maniphest Tasks: T15460

Differential Revision: https://we.phorge.it/D25284
2023-06-12 03:49:34 +02:00
..
codex When destorying a repository, print a notification about removing the working copy 2017-08-01 08:57:39 -07:00
conduit Update Diffusion conduit text 2017-07-02 14:25:10 +00:00
config Remove product literal strings in "pht()", part 22 2022-04-25 16:46:26 -07:00
constants Simplify Create Repository page 2017-08-15 11:05:50 -07:00
customfield Move various other callsites away from callsigns 2016-01-04 06:54:42 -08:00
daemon Add support to marking commits as UNREACHABLE for Mercurial 2021-09-04 19:05:08 -04:00
data Collapse repository URI normalization code into Arcanist 2020-06-30 15:54:33 -07:00
editor Fix PHP 8.1 "strlen(null)" and "preg_match()" exceptions which block repository creation 2023-05-19 17:18:37 +02:00
engine PHP 8.2: fixes for strlen() not accepting NULL anymore, part 1 2023-03-31 22:05:52 +02:00
graphcache Bail out of PhabricatorRepositoryGraphCache more aggressively after cache fills 2017-10-06 14:12:58 -07:00
mail Build separate mail for each recipient, honoring recipient access levels 2015-06-03 18:59:31 -07:00
management Correct spelling mistakes 2023-05-27 22:19:06 +01:00
phid Remove "State Icons" from handles 2019-10-31 12:04:43 -07:00
query Fix PHP 8.1 "strlen(null)" exception which blocks rendering a Diffusion repository page 2023-05-30 10:54:22 +02:00
response Return Git HTTP error messages in an HTTP header 2021-01-26 16:14:03 -08:00
search Add controllers/search/edit engine functionality to RepositoryIdentity 2018-05-31 07:03:25 -07:00
storage Fix PHP 8.1 "strlen(null)" exception initializing Diffusion repository without path access permissions 2023-06-10 22:59:57 +02:00
worker Correct spelling mistakes 2023-05-27 22:19:06 +01:00
xaction Fix PHP 8.1 "strlen(null)" exceptions on History page of Diffusion repo after changing text encoding 2023-06-12 03:49:34 +02:00