1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 16:22:43 +01:00
Commit graph

15791 commits

Author SHA1 Message Date
Nicolas Aragone
4c314a733c Clarifying the operating system choices.
Test Plan: looked at words, words looked good

Reviewers: O1 Blessed Committers, chris

Reviewed By: O1 Blessed Committers, chris

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Tags: #documentation

Differential Revision: https://we.phorge.it/D25427
2023-08-29 20:15:08 -03:00
Andre Klapper
beec08e019 Fix RuntimeException: min(): Array must contain at least one element
Summary:
Make sure that `$epochs[]` is never empty but contains `0` so `min($epochs)` will not complain.

Closes T15623

Test Plan: Carefully read the code (as I am unaware of reproduction steps).

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15623

Differential Revision: https://we.phorge.it/D25417
2023-08-22 18:31:27 +02:00
Andre Klapper
9b105c8e9e Fix PHP 8.1 "strlen(null)" exceptions importing ICS file into calendar
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=df6c315ace5f), phorge(head=importICSCalendar, ref.master=3cc5ee6a33df, ref.importICSCalendar=3bd396120123)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/calendar/import/PhabricatorCalendarImportEngine.php:459]
```

```
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=df6c315ace5f), phorge(head=importICSCalendar, ref.master=3cc5ee6a33df, ref.importICSCalendar=3bd396120123)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/calendar/import/PhabricatorCalendarImportEngine.php:450]
```

Closes T15620

Test Plan:
* Revert rP02a4f8b0c8f1279fc0040ad8077942fd8b0d948b not to run into T15619
* Try to import an ICS file via `/calendar/import/edit/`
* See that page `/calendar/import/4/` renders correctly in web browser and shows `Log Messages` and `Imported Events` as expected

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15620

Differential Revision: https://we.phorge.it/D25411
2023-08-19 10:09:49 +02:00
Aviv Eyal
ba4b8cb1ae PHP 8 and Diviner Technical Documentation
Summary:
This also fixes the field Personal Settings > Display Preferences > Monospaced Font, when empty.

Close T15621

Test Plan: Generate diviner stuff, navigate to the "Technical Documentation" section (In php 8.1+)

Reviewers: O1 Blessed Committers, mturdus, valerio.bozzolan

Reviewed By: O1 Blessed Committers, mturdus, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15621

Differential Revision: https://we.phorge.it/D25412
2023-08-18 15:38:16 -07:00
Valerio Bozzolan
3cc5ee6a33 Documentation: fix unexisting path sshd_config.phabricator.example
Summary:
Since the example file was renamed, this change makes the documentation consistent with it.

Also we added exactly one-space somewhere, to create a super-satisfying indentation an example block. You're welcome.

Ref T15006

Test Plan: Check that the documentation is at least 0.000001% better now.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15006

Differential Revision: https://we.phorge.it/D25410
2023-08-19 00:02:39 +08:00
bob
8876f75fbb Fix a PHP 8.1 deprecated use of strlen with a NULL argument
Summary:
This call is preventing users to browse Subversion repositories.
Using strlen() to check string validity 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.

Fix T15608

Test Plan:
- Sign in
- Open a Diffusion SVN repository
- You should see the repository instead of getting a Runtime Exception

Reviewers: O1 Blessed Committers, Sten, avivey

Reviewed By: O1 Blessed Committers, Sten, avivey

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

Maniphest Tasks: T15608

Differential Revision: https://we.phorge.it/D25398
2023-08-18 15:50:29 +02:00
bob
6ec89e9f08 Fix a PHP 8.1 deprecated use of strlen with a NULL argument
Summary:
With PHP 8.1+ it was not possible to view a commit from subversion repositories.
Indeed, if the commit user and/or email is not properly defined, strlen(null) is called, causing a deprecation warning, elevated to exception.
Using strlen() to check string validity 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.

Fix T15609

Test Plan:
- Apply D25397 and D25398
- Sign in
- Open a diffusion SVN repository
- Open a commit without user name and or email
- You should not see the same Runtime Exception (unfortunately, there is another one as described in T15610)

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15609

Differential Revision: https://we.phorge.it/D25399
2023-08-18 12:48:18 +02:00
Aviv Eyal
ad0052fcd6 Rebrand: Add "path" entries to PlatformSymbols
Summary: Ref T15006. Change a few places that were mentioning `phabricator` path.

Test Plan: Mk1 eyeball on each effected page.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

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

Maniphest Tasks: T15006

Differential Revision: https://we.phorge.it/D25343
2023-08-18 02:00:41 -07:00
Andre Klapper
7c58ea1403 Fix PHP 8.1 "strlen(null)" exception creating a Phriction doc without slug in Conduit
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=df6c315ace5f), phorge(head=master, ref.master=7cffe557ac24)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/phriction/conduit/PhrictionCreateConduitAPIMethod.php:28]
```

Closes T15614

Test Plan: Create a Phriction document without slug via Conduit. Get an `EXCEPTION: (Exception) No such document.` instead of a `strlen()` exception.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15614

Differential Revision: https://we.phorge.it/D25406
2023-08-18 09:50:19 +02:00
Andre Klapper
d84dbf8e27 Fix PHP 8.1 "strlen(null)" exception creating a Paste without content in Conduit paste.create
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=df6c315ace5f), phorge(head=thisThis, ref.master=7cffe557ac24, ref.thisThis=529790613a86)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/paste/conduit/PasteCreateConduitAPIMethod.php:46]
```

Closes T15613

Test Plan: Create a paste in the deprecated API paste.create without content via Conduit. Shows `error_code ERR-NO-PASTE` as expected, and no exception.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15613

Differential Revision: https://we.phorge.it/D25405
2023-08-18 09:48:41 +02:00
bob
0ef08baf64 Fix a PHP 8.1 deprecated use of strlen with a NULL argument
Summary:
This strlen() call was preventing a new Phorge instance to be deployed/configured.
Indeed, on a fresh instance, configuration's "base-uri" key may not be defined witch lead to a Runtime Exception.
Using strlen() to check string validity 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.

Fix T15605

Test Plan:
- Checkout a fresh Phorge local copy from official 'https://we.phorge.it/source/phorge.git'
- Install/Configure local webserver/database
- Open http://phorge.domain in you browser
- Configure Phorge database (as requested by webpage)
- Create Phorge database (as requested by webpage)
- You should be able to reach administrator account page instead of getting a RuntimeException

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15605

Differential Revision: https://we.phorge.it/D25394
2023-08-18 09:20:36 +02:00
bob
7f46a252f2 Fix a PHP 8.1/8.2 deprecated use of strlen a NULL argument
Summary: This commit harmonizes PhabricatorNotificationServerRef's getURI and getWebsocketURI methods as discussed in D25382.

Test Plan: This is hard to say since I didn't know how/when this function might be called.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25401
2023-08-18 09:20:03 +02:00
Andre Klapper
3a1f568974 Fix typo "this this server"
Summary: Closes T15611

Test Plan: Carefully read.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15611

Differential Revision: https://we.phorge.it/D25404
2023-08-17 17:46:11 +02:00
bob
747d7db241 Fix a PHP 8.1/8.2 deprecated use of ltrim and rtrim with a NULL argument
Summary:
These calls were preventing notification servers configuration to be properly initialized.
Indeed, PHP 8.X is stricter concerning
This behavior is deprecated since PHP 8.1. Phorge adopts phutil_nonempty_string() as a replacement.

Fix T15598

Test Plan:
Sign in as an administrator, configure the notification server without filling admin path field,
you shouldn't get both an RuntimeException and a warning indicating that Phorge is unable to connect
to Notification Server but a message indicating that everything is fine.

Reviewers: O1 Blessed Committers, valerio.bozzolan, avivey

Reviewed By: O1 Blessed Committers, valerio.bozzolan, avivey

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

Maniphest Tasks: T15598

Differential Revision: https://we.phorge.it/D25382
2023-08-17 10:41:37 +02:00
bob
a5d8b2d5cf Fix a PHP 8.1 deprecated use of preg_match with a NULL argument
Summary:
These calls are preventing users to browse subversion/mercurial repositories in PHP 8.1+.
Indeed, a similar bug affecting git repositories was already addressed in another commit
(rP6b8ec50148909938850b5acfd11725ae23a8e31b). This commit harmonize both DiffusionSvnRequest
and DiffusionMercurialRequest with DiffusionGitRequest

Fix T15607

Test Plan:
- Sign in
- Open a diffusion SVN/Mercurial repository
- You should not get a RuntimeException concerning this preg_match call

Reviewers: O1 Blessed Committers, Sten, valerio.bozzolan

Reviewed By: O1 Blessed Committers, Sten, valerio.bozzolan

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

Maniphest Tasks: T15607

Differential Revision: https://we.phorge.it/D25397
2023-08-17 10:16:50 +02:00
Andre Klapper
9fa9aa30b9 Fix PHP 8.1 "strlen(null)" exception on "Link External Account" page at login
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(), phorge()
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/applications/auth/controller/PhabricatorAuthSetExternalController.php:43]
```

Closes T15606

Test Plan: Follow steps in T15606; page `/auth/external/` displays as expected the content: "Link External Account - You can link your Phabricator account to an external account to allow you to log in more easily in the future. To continue, choose an account to link below. If you prefer not to link your account, you can skip this step." and the "Link External Account" button.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

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

Maniphest Tasks: T15606

Differential Revision: https://we.phorge.it/D25395
2023-08-16 15:04:18 +02:00
Andre Klapper
29493f8a5c Fix PHP 8.1 "strlen(null)" exception listing >100 task search results
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=df6c315ace5f), phorge(head=master, ref.master=7040bd525764)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/maniphest/query/ManiphestTaskQuery.php:1039]
```

Closes T15604

Test Plan: Have more than 100 tasks, run a broad search with more than 100 results, try to go to next page of results.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15604

Differential Revision: https://we.phorge.it/D25392
2023-08-16 10:58:08 +02:00
Andre Klapper
7040bd5257 Fix PHP 8.1 "strlen(null)" exception adding "Build with Buildkite" build step in Harbormaster
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=customOAuthUrlencodeNull, ref.master=788098096e11, ref.customOAuthUrlencodeNull=4f0f2043b7e9), phorge(head=master, ref.master=226f3150933d)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php:271]
```

Closes T15594

Test Plan: Add a build step in Harbormaster, select "Interacting with External Build Systems > Build with Buildkite" at `/harbormaster/step/new/1/HarbormasterBuildkiteBuildStepImplementation/`, select the "Create Build Step" button. Page now shows several expected error messages (API Token is required; Organization Name is required; etc) instead of a PHP error.

Reviewers: O1 Blessed Committers, Matthew

Reviewed By: O1 Blessed Committers, Matthew

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

Maniphest Tasks: T15594

Differential Revision: https://we.phorge.it/D25379
2023-08-15 10:15:32 +02:00
Aviv Eyal
bcfcd9acfc Unify type-checking for setHref() type methods
Summary:
Adopt `PhutilURI::checkHrefType()` to unify type-check of some PHUI objects.

Ref T15316. Depends on D25356.

Test Plan: In production.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

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

Maniphest Tasks: T15316

Differential Revision: https://we.phorge.it/D25357
2023-08-12 08:39:13 -07:00
Steve Campbell
e8ea7a4a36 Fix PHP 8.1 issue in DifferentialChangeset getOldStatePathVector()
Summary:
The DifferentialChangeset getOldStatePathVector() method assumes oldFile and filename are set.
This worked under PHP <= 8.0, but fails for PHP >= 8.1 with error messsage

```
strlen(): Passing null to parameter #1 ($string) of type string is deprecated
```

Fixes T15517

Test Plan:
Create a diff in which a new file is added.
This file will have oldFile NULL and filename a string.
View the diff https://my.phorge.site/D1234

Reviewers: O1 Blessed Committers, Matthew

Reviewed By: O1 Blessed Committers, Matthew

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

Maniphest Tasks: T15517

Differential Revision: https://we.phorge.it/D25323
2023-08-12 08:39:36 +01:00
Andre Klapper
98dfac53ba Fix PHP 8.1 "strlen(null)" exceptions blocking account registration with custom OAuth provider after redirect
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(), ava(), phorge(), wmf-ext-misc()
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/applications/auth/provider/PhabricatorOAuth1AuthProvider.php:70]
```

```
EXCEPTION: (RuntimeException) strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
arcanist(), ava(), phorge(), wmf-ext-misc()
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/applications/auth/view/PhabricatorAuthAccountView.php:32]
```

Closes T15590

Test Plan:
* As an admin, set up custom "MediaWiki" OAuth provider from from https://gitlab.wikimedia.org/-/ide/project/repos/phabricator/extensions/edit/wmf/stable/-/src/oauth/
* As an admin, apply D25373
* As a user, go to `/auth/login/mediawiki:whatever/`
* Select login button
* Allow authentication on third-party site
* Get redirected to Phorge instance
Phorge user account registration page "Create a New Account" at `/auth/register/abcdefghijklmnopqrstuvwxyz0123456/` now renders as expected, instead of displaying errors only.

Reviewers: O1 Blessed Committers, Matthew

Reviewed By: O1 Blessed Committers, Matthew

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

Maniphest Tasks: T15590

Differential Revision: https://we.phorge.it/D25375
2023-08-11 21:03:02 +02:00
Andre Klapper
a2e8ab3180 Fix PHP 8.1 "strlen(null)" exception adding a "Drydock: Run Command" build step in Harbormaster
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=customOAuthUrlencodeNull, ref.master=788098096e11, ref.customOAuthUrlencodeNull=4f0f2043b7e9), phorge(head=master, ref.master=226f3150933d)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/harbormaster/controller/HarbormasterStepEditController.php:142]
```

Closes T15592

Test Plan: Add a build step for an existing Harbormaster Build Plan, see that page `New Step: Drydock: Run Command` is correctly rendered at `/harbormaster/step/new/1/HarbormasterDrydockCommandBuildStepImplementation/`

Reviewers: O1 Blessed Committers, Matthew

Reviewed By: O1 Blessed Committers, Matthew

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

Maniphest Tasks: T15592

Differential Revision: https://we.phorge.it/D25377
2023-08-11 21:01:39 +02:00
Andre Klapper
c61c6a1ec3 Fix PHP 8.1 "strlen(null)" exception adding a Harbormaster Build Plan
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=customOAuthUrlencodeNull, ref.master=788098096e11, ref.customOAuthUrlencodeNull=4f0f2043b7e9), phorge(head=master, ref.master=226f3150933d)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/harbormaster/editor/HarbormasterBuildPlanEditEngine.php:106]
```

Closes T15591

Test Plan: Visit `/harbormaster/plan/edit/form/default/`. "Create Build Plan" page renders as expected.

Reviewers: O1 Blessed Committers, Matthew

Reviewed By: O1 Blessed Committers, Matthew

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

Maniphest Tasks: T15591

Differential Revision: https://we.phorge.it/D25376
2023-08-11 21:00:46 +02:00
Andre Klapper
085769ceb6 Fix PHP 8.1 "strlen(null)" exceptions trying to authenticate via custom OAuth provider
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.

This change also replaces two other `strlen()` calls, only based on //reading// the code but not based on triggering exceptions.

```
EXCEPTION: (RuntimeException) strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
arcanist(), ava(), phorge(), wmf-ext-misc()
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/applications/auth/adapter/PhutilOAuth1AuthAdapter.php:121]
```

```
EXCEPTION: (RuntimeException) strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261]
arcanist(), ava(), phorge(), wmf-ext-misc()
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/applications/auth/adapter/PhutilOAuth1AuthAdapter.php:125]
```

Closes T15588

Test Plan: Go to `/auth/login/mediawiki:whatever/` and at least see no `strlen()` errors anymore (while further issues remain). See T15588 for details.

Reviewers: O1 Blessed Committers, Matthew

Reviewed By: O1 Blessed Committers, Matthew

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

Maniphest Tasks: T15588

Differential Revision: https://we.phorge.it/D25373
2023-08-11 20:57:51 +02:00
Andre Klapper
10ee019785 Fix PHP 8.1 "strlen(null)" exception setting Passphrase Credential
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=788098096e11), phorge(head=master, ref.master=840a7fab2bc8)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/passphrase/view/PassphraseCredentialControl.php:53]
```

Closes T15580

Test Plan: Set URI for a Diffusion Repository, select URI and select "Set Credential". Page "Edit Repository URI" at `/diffusion/123/uri/edit/456/` renders as expected in web browser.

Reviewers: O1 Blessed Committers, Matthew

Reviewed By: O1 Blessed Committers, Matthew

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

Maniphest Tasks: T15580

Differential Revision: https://we.phorge.it/D25370
2023-08-11 20:56:49 +02:00
Aviv Eyal
eb0bb17368 Replace dedicated Commit Field with an existing one
Summary: fix T15600

Test Plan: arc diff against this

Reviewers: Sten, O1 Blessed Committers!

Reviewed By: Sten

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

Maniphest Tasks: T15600

Differential Revision: https://we.phorge.it/D25385
2023-08-11 11:42:50 -07:00
sten
8310591523 Fix DifferentialDiff getFieldValuesForConduit PHP 8.1 strlen(null) errors
Summary:
Fix DifferentialDiff getFieldValuesForConduit PHP 8.1 strlen(null) errors by replacing the strlen() calls with phutil_nonempty_string().

Also needed to update DifferentialDiffTestCase.php to being a PhabricatorTestCase, as it was throwing an exception prior to any code changes -
```
EXCEPTION (Exception): Trying to read configuration "policy.locked" before configuration has been initialized.
```

Fixes T15529

Test Plan: arc diff

Reviewers: O1 Blessed Committers, valerio.bozzolan, avivey

Reviewed By: O1 Blessed Committers, valerio.bozzolan, avivey

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

Maniphest Tasks: T15529

Differential Revision: https://we.phorge.it/D25333
2023-08-11 10:40:11 +01:00
Steve Campbell
4b3c384856 Fix DifferentialCommitMessageField renderFieldValue PHP 8.1 strlen(null) error
Summary:
arc diff throws strlen(null) error from DifferentialCommitMessageField renderFieldValue when calling a Phorge server running PHP 8.1

Add unit test, which required a new DifferentialTestCommitMessageField class so as to be able to test the abstract DifferentialCommitMessageField class methods.

Fixes T15530

Test Plan:
Make a change in a git repo with remote a Phorge server running PHP 8.1
Run:

```
arc diff
```
See exception thrown as per T15530

Reviewers: O1 Blessed Committers, valerio.bozzolan, avivey

Reviewed By: O1 Blessed Committers, valerio.bozzolan, avivey

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

Maniphest Tasks: T15530

Differential Revision: https://we.phorge.it/D25334
2023-08-11 10:38:20 +01:00
Steve Campbell
9c8b9a6bbf Fix PHP 8.1 trim(null) exception in ./bin/diviner generate
Summary:
When running './bin/diviner generate' under PHP 8.1, we get a trim(null) exception.

Fixes T15548

Test Plan: Run './bin/diviner generate'

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

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

Maniphest Tasks: T15548

Differential Revision: https://we.phorge.it/D25353
2023-08-11 10:37:31 +01:00
bob
eb2be08f9f Fix PHP 8.1/8.2 "strlen(null)" exception in SearchController
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.

EXCEPTION: (RuntimeException) strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [<arcanist>/src/error/PhutilErrorHandler.php:261];
PHP message: arcanist(head=master, ref.master=6e4947b55f09), phorge(head=master, ref.master=7bebfa289aa1);
PHP message:   #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/search/controller/PhabricatorSearchController.php:16];

Fix T15595

Test Plan: Search something using the main search bar. It should return something (or not) instead to throwing a RuntimeException.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

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

Maniphest Tasks: T15595

Differential Revision: https://we.phorge.it/D25380
2023-08-10 17:42:17 +02:00
root
2da7594344 Fix a PHP 8.1/8.2 deprecated call to strlen with a NULL argument
Summary:
This call was preventing notification servers configuration to be properly initialized.
Indeed, 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.

Fix T15596

Test Plan:
Sign in as an administrator, configure the notification server without filling admin path field,
you shouldn't get an invalid configuration error

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

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

Maniphest Tasks: T15596

Differential Revision: https://we.phorge.it/D25381
2023-08-10 17:36:35 +02:00
Andre Klapper
226f315093 Fix PHP 8.1 "strlen(null)" exception creating Blueprint Working Copy
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, however use `phutil_nonempty_scalar()` as the value might not necessarily be a string object.

Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_scalar() 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=788098096e11), phorge(head=arcpatch-D25239, ref.master=840a7fab2bc8, ref.arcpatch-D25239=870d62ce0ed9)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldInt.php:36]
```

Closes T15581

Test Plan:
Page `Create Blueprint` at `/drydock/blueprint/edit/form/default/` renders as expected in web browser.

Try also creating a custom integer field and put some fuzzy data.

https://we.phorge.it/book/phorge/article/custom_fields/

Test these values:

- 1 (stays as-is)
- 0 (stays as-is)
- 123.45 (becomes 123)
- a "lizard" (becomes zero)
- empty ("") (becomes empty)

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

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

Maniphest Tasks: T15581

Differential Revision: https://we.phorge.it/D25371
2023-08-05 23:29:12 +02:00
Andre Klapper
39b576b145 Add HTML header for Atom/RSS discovery on Phame blog pages
Summary:
Allow easier discovery and subscribing to Atom feeds of Phame blogs.

To be extra cautious, also make sure that the added line is a `PhutilSafeHTML`.

Original author: @20after4

Closes T15550

Test Plan: Go to `/phame/blog/view/1/` and check the HTML source code. See an additional `<link>` item with `type="application/atom+xml"` in the `<head>` section.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: avivey, speck, tobiaswiese, valerio.bozzolan, Matthew, 20after4, Cigaryno

Maniphest Tasks: T15550

Differential Revision: https://we.phorge.it/D25346
2023-08-05 23:26:34 +02:00
Andre Klapper
9fe2bfebe8 Fix PHP 8.1 "strlen(null)" exception adding LDAP authentication
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=788098096e11), phorge(head=master, ref.master=840a7fab2bc8)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/auth/provider/PhabricatorLDAPAuthProvider.php:430]
```

Closes T15587

Test Plan: Go to `/auth/config/edit/?provider=PhabricatorLDAPAuthProvider` and see that "Add Auth Provider: LDAP" page is rendered.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

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

Maniphest Tasks: T15587

Differential Revision: https://we.phorge.it/D25372
2023-08-04 18:06:13 +02:00
Valerio Bozzolan
840a7fab2b Hide Archived Panels from Dashboards
Summary:
In edit mode, Archived Panels are shown differently,
with content text in grey and with the usual red tag.

In view mode, Archived Panels are just not rendered.

This makes it easier to design Dashboards with individual
components that can be de-activated and re-activated on the fly.

Closes T15366.

{F325637}

Test Plan:
Have a Dashboard somewhere (e.g in your homepage).

Visit a Panel (W-ID) and Archive it.

See that now the Panel is not shown anymore on the Dashboard.

Edit the Dashboard and you see the Panel again as "Archived".

Anything around is just normal.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: avivey, speck, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15366

Differential Revision: https://we.phorge.it/D25368
2023-08-01 09:51:18 +02:00
Benjamin Kausch
df3ac50cb7 Implements a more informative hovercard for wiki documents
Summary:
The current hovercard of a wiki document has no further information except the title. This commit adds object type, project tags, parent documents, last author and last edited time to the card.

Preview:

{F313614}

Preview in a pessimistic case:

{F325478}

Closes T15433

Test Plan: Edit a wiki document with/without project tags and parent documents and see the hovercard in the feed.

Reviewers: O1 Blessed Committers, valerio.bozzolan, avivey, Cigaryno

Reviewed By: O1 Blessed Committers, valerio.bozzolan, avivey, Cigaryno

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

Maniphest Tasks: T15433

Differential Revision: https://we.phorge.it/D25303
2023-07-31 17:33:36 +02:00
sten
4cedb928aa Fix arc patch PHP 8.1 strlen(null) error
Summary:
Fix arc patch PHP 8.1 strlen(null) error.

When doing an 'arc patch Dxxxx' against a diff on a PHP 8.1 Phorge server we get a strlen(null) error.
Updating the idx call to provide a default empty string resolves it.
Providing a default empty string to

Fixes T15571

Test Plan: arc patch Dxxxx

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

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

Maniphest Tasks: T15571

Differential Revision: https://we.phorge.it/D25364
2023-07-29 17:36:13 +01:00
sten
007e7621f2 Fix HarbormasterBuildUnitMessage PHP 8.1 strlen(null) error
Summary:
Fix HarbormasterBuildUnitMessage PHP 8.1 strlen(null) error.

Fixes T15572

Test Plan: Do an 'arc diff' to a PHP 8.1 Phorge server when doing so will trigger unit tests.

Reviewers: O1 Blessed Committers, speck

Reviewed By: O1 Blessed Committers, speck

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

Maniphest Tasks: T15572

Differential Revision: https://we.phorge.it/D25365
2023-07-29 13:04:11 +01:00
sten
1802ebd2cc Fix PHP 8.1 Diffusion history errors
Summary:
Fix multiple PHP 8.1 errors when viewing Diffusion history.

Fixes T15573

Test Plan: View a diffusion history page. Eg https://my.php81.phorge.site/source/myrepo/history/master/

Reviewers: O1 Blessed Committers, speck

Reviewed By: O1 Blessed Committers, speck

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

Maniphest Tasks: T15573

Differential Revision: https://we.phorge.it/D25366
2023-07-29 13:03:48 +01:00
c7574226
189a5d6047 Fix strlen(null) PHP 8.1 error when pushing into a fresh repository
Summary:
Doing a git push into a fresh repository over https fails with a PHP 8.1 strlen(null) error.

This fixes it.

Fixes T15569

Test Plan:
* Create an empty repository on a PHP 8.1 Phorge instance
* Clone it
* Add some data
* git push

Reviewers: O1 Blessed Committers, speck

Reviewed By: O1 Blessed Committers, speck

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

Maniphest Tasks: T15569

Differential Revision: https://we.phorge.it/D25361
2023-07-28 18:22:55 +01:00
Valerio Bozzolan
1aa532a476 Workboard Columns: avoid page reload on Edit > Cancel
Summary:
The rationale for this change is that reloading a page unnecessarily wastes
resources that we can save.

This includes human resources (time) but also computational resources
as well. We probably save a fawn for every 1,000 clicks on that button.
A message to Greta Thunberg: now Phorge is with you.

This is the involved "Cancel" button, that does not reload the page anymore:

{F309894}

Closes T15471

Test Plan:
Workboard > Column > Edit > Cancel:

The popup closes gracefully instead of a page refresh.

Also try opening the workflow in another tab (/project/board/1/hide/2/) > Cancel:

You turn back to your Workboard just as before.

Reviewers: O1 Blessed Committers, Matthew

Reviewed By: O1 Blessed Committers, Matthew

Subscribers: speck, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15471

Differential Revision: https://we.phorge.it/D25302
2023-07-28 19:02:40 +02:00
Valerio Bozzolan
1e3c9bdfee Update Diff: fix dead-end when not yours
Summary:
Fix "Update Patch" for generic Differential revisions.

You can now help a coworker to update their patch, from the web.

So, if you visit Diff 111 (not yours) and you click "Update Diff", and you paste a valid diff,
you arrive here:

    https://we.phorge.it/differential/diff/222/?revisionID=111

That page as default was suggesting some Diffs that are yours. Plus, now it shows Diff 111.

Omitting the Diff from which the workflow was started made no sense and it's certainly an oversight.

Any follow-up change is welcome to modernize the selector using AphrontFormTokenizerControl.

Closes T15538

Test Plan:
- create a Diff on Differential with user A
- click on Update Diff from user B (pasting a valid diff) and Continue

Now that patch is selected (and selectable). No dead-end anymore.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: avivey, speck, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15538

Differential Revision: https://we.phorge.it/D25337
2023-07-25 14:15:03 +02:00
Aviv Eyal
bf025c5fb4 Aphlict - search for default config in the right place
Summary: Fix T15502.

Test Plan: Renamed `phorge` dir few times, run `./bin/aphlict status` to see message.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

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

Maniphest Tasks: T15502

Differential Revision: https://we.phorge.it/D25344
2023-07-24 00:42:06 -07:00
Valerio Bozzolan
0f07c07b3b Attach Diff to Revision: fix Repository asked twice
Summary:
If you manually upload a Diff (patch) from the Differential web
interface you can select the Repository.

We fix the default value of the Repository field during creation mode,
guessing the repo from the potentially already-available diff.

Closes T15537

Test Plan:
- Create a cute Differential Revision from web
- Pick a Repository > Continue
- Create a new Revision > Continue

At this point you should still have that repository instead of nothing.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: avivey, speck, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15537

Differential Revision: https://we.phorge.it/D25338
2023-07-22 13:55:41 +02:00
Steve Campbell
cb9fcf18d5 Fix PHP 8.1 "strlen(null)" exception trying to stop maintenance mode of Diffusion repo
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.

Use `isset` instead to check if the argument "start" was passed to the CLI command.

```
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=repoMaintStartHistory, ref.master=1c098c273d06, ref.repoMaintStartHistory=0a4a34143528)
  #0 PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/applications/repository/management/PhabricatorRepositoryManagementMaintenanceWorkflow.php:45]
```

Closes T15476

Test Plan: After applying this change, executing `./bin/repository maintenance --stop R1` on the CLI shows `Took repository "R1" out of maintenance mode.` as expected, instead of an exception.

Reviewers: O1 Blessed Committers, valerio.bozzolan, aklapper, avivey

Reviewed By: O1 Blessed Committers, valerio.bozzolan, avivey

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

Maniphest Tasks: T15476

Differential Revision: https://we.phorge.it/D25296
2023-07-18 09:06:25 +01:00
Steve Campbell
27fa498966 Fix PHP 8.1 strlen(null) error in PhabricatorFile::newChunkedFile()
Summary:
Fix PHP 8.1 strlen(null) error in PhabricatorFile::newChunkedFile().

Fixes T15499

Test Plan:
Added a unit test which replicated the fault, so you can test simply by 'arc unit'
Alternatively, see test in T15499

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

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

Maniphest Tasks: T15499

Differential Revision: https://we.phorge.it/D25352
2023-07-17 14:24:41 +01:00
Steve Campbell
dbc101ca8a Fix PHP 8.1 substr(null) in People > Activity Logs
Summary:
When someone tries to log on with invalid credentials, a record is inserted in the phabricator_user.user_log table with action = login-fail.
The session value of this record is set to null in this case.

When you open the People → Activity Logs screen, you will see an exception because of this.

Fixes T15555

Test Plan: Go to https://my.phorge.site/people/logs/ after a login failure and a login success.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

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

Maniphest Tasks: T15555

Differential Revision: https://we.phorge.it/D25351
2023-07-17 14:23:30 +01:00
Steve Campbell
849e18ccbb Fix PhabricatorRepository generateURI PHP 8.1 strlen(null) errors
Summary:
When viewing a repository in Diffusion, clicking on a folder (eg https://my.phorge.site/source/myrepo/browse/master/myfolder/) will generate multiple strlen(null) exceptions under PHP 8.1

Fix is to replace all the strlen() calls with phutil_nonempty_string()

Fixes T15532

Test Plan: View a folder in a repo in Diffusion. Eg https://my.phorge.site/source/myrepo/browse/master/myfolder/

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

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

Maniphest Tasks: T15532

Differential Revision: https://we.phorge.it/D25336
2023-07-17 11:07:25 +01:00
Steve Campbell
8af1624692 Fix passing null to trim() error in DiffusionBrowseTableView render()
Summary:
When viewing the top level of a diffusion repository, $request->getPath() returns null, which then causes trim() to throw an error.

Fix is to update DiffusionRequest getPath() such that it returns '' instead of null, thus fixing it's return type.

Fixes T15522

Test Plan: Go to https://my.phorge.site/source/myrepo

Reviewers: O1 Blessed Committers, valerio.bozzolan, avivey

Reviewed By: O1 Blessed Committers, valerio.bozzolan, avivey

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

Maniphest Tasks: T15522

Differential Revision: https://we.phorge.it/D25329
2023-07-17 11:05:18 +01:00
Steve Campbell
65e57fe23d Fix PHP 8.1 PhabricatorEditorURIEngine::newForViewer() trim(NULL) error
Summary:
Under PHP 8.1, PhabricatorEditorURIEngine::newForViewer() is throwing a trim(NULL) error when trying to view a diff.
This is because it tries to apply string operations to a user setting which will be null by default.

Fixes T15518

Test Plan:
Unit test added -
  arc unit

Or just view a diff. Eg:
	https://my.phorge.site/D1234

Reviewers: O1 Blessed Committers, valerio.bozzolan, avivey

Reviewed By: O1 Blessed Committers, valerio.bozzolan, avivey

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

Maniphest Tasks: T15518

Differential Revision: https://we.phorge.it/D25324
2023-07-17 11:03:52 +01:00