@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix PHP 8.1 "trim(null)" exception in project.create for missing name

Summary:
Passing `null` to `trim()` is deprecated since PHP 8.1.
Convert null to an empty string to avoid complaints about trim, strlen, and PhabricatorSlug::isValidProjectSlug() expecting strings.

```
ERROR 8192: trim(): Passing null to parameter #1 ($string) of type string is deprecated at [/var/www/html/phorge/phorge/src/applications/project/xaction/PhabricatorProjectNameTransaction.php:75]
```
Closes T16420

Test Plan:
* PHP 8.1+
* Go to Go to http://phorge.localhost/conduit/method/project.create/
* Press the "Call Method" button

Reviewers: O1 Blessed Committers, mainframe98

Reviewed By: O1 Blessed Committers, mainframe98

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16420

Differential Revision: https://we.phorge.it/D26649

+1 -1
+1 -1
src/applications/project/xaction/PhabricatorProjectNameTransaction.php
··· 71 71 72 72 $max_length = $object->getColumnMaximumByteLength('name'); 73 73 foreach ($xactions as $xaction) { 74 - $new_value = $xaction->getNewValue(); 74 + $new_value = $xaction->getNewValue() ?? ''; 75 75 $new_value = trim($new_value); // Strip surrounding whitespace 76 76 $xaction->setNewValue($new_value); 77 77 $new_length = strlen($new_value);