Page MenuHomePhorge

Fix PHP 8.1 "preg_match(null)" exception exporting task list to CSV
ClosedPublic

Authored by aklapper on Apr 2 2024, 20:31.
Tags
None
Referenced Files
F3005760: D25567.1740540868.diff
Tue, Feb 25, 03:34
F3005361: D25567.1740519376.diff
Mon, Feb 24, 21:36
F2996784: D25567.1740386148.diff
Sun, Feb 23, 08:35
F2996783: D25567.1740386145.diff
Sun, Feb 23, 08:35
F2996782: D25567.1740386139.diff
Sun, Feb 23, 08:35
F2996630: D25567.1740382643.diff
Sun, Feb 23, 07:37
F2982840: D25567.1739971972.diff
Tue, Feb 18, 13:32
F2982783: D25567.1739971839.diff
Tue, Feb 18, 13:30

Details

Summary

When a column value to export to CSV is empty, null is passed to preg_match() which is deprecated behavior since PHP 8.1.
Thus only call preg_match() when the value is set.

ERROR 8192: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated at [/var/www/html/phorge/phorge/src/infrastructure/export/format/PhabricatorCSVExportFormat.php:51]
ERROR 8192: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated at [/var/www/html/phorge/phorge/src/infrastructure/export/format/PhabricatorCSVExportFormat.php:55]

Closes T15770

Test Plan

Export a Maniphest task list of query results to CSV.

Diff Detail

Repository
rP Phorge
Lint
Lint Not Applicable
Unit
Tests Not Applicable