@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 "addcslashes(null)" exception exporting task list to tab-separated text

Summary:
When a column value to export to Tab-Separated Text is empty, `null` is passed to `addcslashes()` which is deprecated behavior since PHP 8.1.
Thus only call `addclashes()` when the value is set.

```
ERROR 8192: addcslashes(): Passing null to parameter #1 ($string) of type string is deprecated at [/var/www/html/phorge/phorge/src/infrastructure/export/format/PhabricatorTextExportFormat.php:45]
```

Closes T15771

Test Plan: Export a Maniphest task list of query results to Tab-Separated Text.

Reviewers: O1 Blessed Committers, 20after4, speck

Reviewed By: O1 Blessed Committers, 20after4, speck

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

Maniphest Tasks: T15771

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

+3 -1
+3 -1
src/infrastructure/export/format/PhabricatorTextExportFormat.php
··· 42 42 private function addRow(array $values) { 43 43 $row = array(); 44 44 foreach ($values as $value) { 45 - $row[] = addcslashes($value, "\0..\37\\\177..\377"); 45 + if (phutil_nonempty_string($value)) { 46 + $row[] = addcslashes($value, "\0..\37\\\177..\377"); 47 + } 46 48 } 47 49 48 50 $this->rows[] = implode("\t", $row);