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
F2938367: D25567.1737994348.diff
Sun, Jan 26, 16:12
F2936361: D25567.1737915924.diff
Sat, Jan 25, 18:25
F2936360: D25567.1737915919.diff
Sat, Jan 25, 18:25
F2936233: D25567.1737911009.diff
Sat, Jan 25, 17:03
F2922598: D25567.1737573713.diff
Tue, Jan 21, 19:21
F2900834: D25567.1737272039.diff
Sat, Jan 18, 07:33
F2892237: D25567.1737217710.diff
Fri, Jan 17, 16:28
F2875014: D25567.1736968299.diff
Tue, Jan 14, 19:11

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