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
F3552916: D25567.1744911912.diff
Wed, Apr 16, 17:45
F3502342: D25567.1744796464.diff
Tue, Apr 15, 09:41
F3502341: D25567.1744796463.diff
Tue, Apr 15, 09:41
F3482879: D25567.1744770580.diff
Tue, Apr 15, 02:29
F3402312: D25567.1744566751.diff
Sat, Apr 12, 17:52
F3402276: D25567.1744566029.diff
Sat, Apr 12, 17:40
F3379005: D25567.1744362766.diff
Thu, Apr 10, 09:12
F3372807: D25567.1744252418.diff
Wed, Apr 9, 02:33

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