1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 16:52:41 +01:00
phorge-phorge/src/applications/phriction
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
..
application Fix Phriction document previews for the root document ("/") with Apache option "MergeSlashes On" 2021-08-02 08:36:15 -07:00
codex Remove "stronger/weaker" policy color hints from object headers 2019-11-18 22:05:26 -08:00
conduit Fix PHP 8.1 "strlen(null)" exception creating a Phriction doc without slug in Conduit 2023-08-18 09:50:19 +02:00
constants Give Phriction documents modern string status constants instead of numeric constants 2018-02-15 18:23:41 -08:00
controller Pass a real context object to Phriction previews, fixing mentions 2021-08-02 08:36:15 -07:00
editor Fix PHP 8.1 "strlen(null)" exception which blocks deleting Phriction document 2023-05-24 18:09:12 +02:00
engineextension Implements a more informative hovercard for wiki documents 2023-07-31 17:33:36 +02:00
herald Add a "Published document changed" rule to Herald for Phriction documents 2019-05-16 10:40:52 -07:00
mail phtize all the things 2015-05-22 21:16:39 +10:00
markup Pass a real context object to Phriction previews, fixing mentions 2021-08-02 08:36:15 -07:00
phid Give PhrictionContent objects (older versions of wiki pages) legitimate PHIDs 2018-02-15 17:39:07 -08:00
query Provide a default "loadPage()" implementation on "CursorPagedPolicyAwareQuery" 2022-05-24 10:18:53 -07:00
search Partially clean up Phriction document status constants; introduce "phriction.document.search" 2018-02-15 18:19:10 -08:00
storage When creating a Phriction document, mark initial transactions as "create" transactions to fix weird email 2019-05-22 16:28:25 -07:00
typeahead Phriction: clarify its search results as "Wiki page" 2023-04-05 15:39:41 +02:00
xaction Remove "Moved Document from ..." notice in Phriction 2019-09-12 09:32:26 -07:00