mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 00:32:42 +01:00
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
This commit is contained in:
parent
0d9ca2589f
commit
79464882da
1 changed files with 3 additions and 1 deletions
|
@ -42,8 +42,10 @@ final class PhabricatorTextExportFormat
|
||||||
private function addRow(array $values) {
|
private function addRow(array $values) {
|
||||||
$row = array();
|
$row = array();
|
||||||
foreach ($values as $value) {
|
foreach ($values as $value) {
|
||||||
|
if (phutil_nonempty_string($value)) {
|
||||||
$row[] = addcslashes($value, "\0..\37\\\177..\377");
|
$row[] = addcslashes($value, "\0..\37\\\177..\377");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->rows[] = implode("\t", $row);
|
$this->rows[] = implode("\t", $row);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue