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
F2982840: D25567.1739971972.diff
Tue, Feb 18, 13:32
F2982783: D25567.1739971839.diff
Tue, Feb 18, 13:30
F2977934: D25567.1739659776.diff
Fri, Feb 14, 22:49
F2977933: D25567.1739659776.diff
Fri, Feb 14, 22:49
F2977923: D25567.1739659112.diff
Fri, Feb 14, 22:38
F2977916: D25567.1739658050.diff
Fri, Feb 14, 22:20
F2961988: D25567.1739170762.diff
Sun, Feb 9, 06:59
F2946675: D25567.1738407137.diff
Fri, Jan 31, 10:52

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
Branch
csvExport (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 1142
Build 1142: arc lint + arc unit