1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-30 02:32:42 +01:00
phorge-phorge/src/applications/differential
Andre Klapper 25c4f6224d Fix some PHP 8.1 "strlen(null)" exceptions on Differential Revision 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=18554ea76ceb), phorge(head=diff3, ref.master=e11c5486c92b, ref.diff3=e11c5486c92b)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/differential/customfield/DifferentialBranchField.php:42]
```

Closes T15432

Test Plan: After applying these three changes (on top of D25262 and D25263), there is no `strlen()` related exception displayed on `/D1/` anymore, however there are further exceptions to be sorted out in other tasks.

Reviewers: O1 Blessed Committers, speck

Reviewed By: O1 Blessed Committers, speck

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

Maniphest Tasks: T15432

Differential Revision: https://we.phorge.it/D25264
2023-06-08 14:49:28 +02:00
..
__tests__ Make "Highlight As..." sticky across reloads in Diffusion and Differential 2020-04-19 08:58:39 -07:00
application Add a debug view of the "Affected Path" index to Differential 2021-03-15 16:16:09 -07:00
capability Simplify the implementation of PhabricatorPolicyCapability subclasses 2014-07-25 08:25:42 +10:00
command Fix another stray "msort()/msortv()" issue 2019-06-17 13:20:10 -07:00
conduit Remove support for "paths" parameter in "differential.query" 2021-03-15 16:16:08 -07:00
config Remove product literal strings in "pht()", part 17 2022-04-25 16:46:25 -07:00
constants Replace Differential "lint stars" with icons 2021-03-17 13:45:52 -07:00
controller Remove product literal strings in "pht()", part 17 2022-04-25 16:46:25 -07:00
customfield Fix some PHP 8.1 "strlen(null)" exceptions on Differential Revision page 2023-06-08 14:49:28 +02:00
doorkeeper Remove "metamta.*.subject-prefix" options 2019-01-17 19:18:50 -08:00
edge Update parent/child revision timeline messages to use modern language ("parent revision") 2018-07-13 09:02:10 -07:00
editor Fix PHP 8.1 "preg_match(null)" exception on "Create Revision" page in Differential when not entering data 2023-06-08 14:48:45 +02:00
engine Update table schema for "AffectedPath" table 2021-03-15 16:16:10 -07:00
engineextension Add a "commits" attachment to "differential.diff.search" for retrieving local commit information 2018-04-19 17:25:06 -07:00
exception Remove an unused class 2015-01-03 09:07:32 +11:00
field Move misplaced validation for ambiguous fields in "Test Plan" to the right place 2017-06-30 06:36:05 -07:00
garbagecollector Add a very forgiving GC for Differential viewstate information 2020-04-23 14:17:48 -07:00
harbormaster Don't try to publish build results to bare diffs 2019-02-13 12:19:29 -08:00
herald Implement an "Author's packages" Herald field for Differential 2020-01-22 18:27:51 -08:00
lipsum Fix deprecated argument order for "implode()" 2019-10-17 09:11:27 -07:00
mail Update out-of-date API calls when rendering diffs inline in email 2020-05-19 10:39:58 -07:00
management Fix additional "xprintf()"-class static parameter lint errors 2020-09-08 11:45:48 -07:00
parser Remove product literal strings in "pht()", part 5 2022-04-25 12:22:27 -07:00
phid Add a PHID to Changesets 2021-02-15 11:11:12 -08:00
query Provide a default "loadPage()" implementation on "CursorPagedPolicyAwareQuery" 2022-05-24 10:18:53 -07:00
relationships Convert all standard relationship-editing actions to modern Relationships code 2016-06-29 11:24:52 -07:00
remarkup Rename PhutilRemarkupRule subclasses 2014-08-05 00:55:43 +10:00
render Remove product literal strings in "pht()", part 5 2022-04-25 12:22:27 -07:00
search Remove Ferret function aliases and overrides 2020-04-16 13:40:17 -07:00
storage Remove product literal strings in "pht()", part 5 2022-04-25 12:22:27 -07:00
typeahead Support "none()" in Differential to find revisions with no (un-resigned) reviewers 2019-05-21 12:56:59 -07:00
view Correct minor "jump to symbol" behavior in Differential 2021-03-17 15:32:07 -07:00
xaction Correct two spelling mistakes in Differential 2023-05-30 10:46:10 +02:00
DifferentialGetWorkingCopy.php Extend from Phobject 2015-06-15 18:02:27 +10:00