PHP 8.1: Do not pass null to ctype_digit() in AphrontFormDateControlValue::getStandardDateFormat()
Summary:
PHP 8.1 warns that ctype_digit(): Argument of type null will be interpreted as string in the future. Thus do not pass a null value to ctype_digit() in AphrontFormDateControlValue but check first that the value is not null.
ERROR 8192: ctype_digit(): Argument of type null will be interpreted as string in the future at [/var/www/html/phorge/phorge/src/view/form/control/AphrontFormDateControlValue.php:332]
(It does not matter if we return null or return '' as the new fallback of getStandardDateFormat() - Phorge seems to handle both in this case.)
Closes T15994
Test Plan:
- Go to http://phorge.localhost/T1, select "Start Tracking Time", remove both values, click the "Start Timer" button
- Go to http://phorge.localhost/phrequent/ and see that the task is listed
- Go to http://phorge.localhost/T1, select "Stop Tracking Time", remove both values, click the "Stop Timer" button
- Go to http://phorge.localhost/phrequent/ and see that the task is not listed
- Use a non-standard task creation form via http://phorge.localhost/maniphest/task/edit/form/5/ which has custom date fields visible and editable defined via http://phorge.localhost/config/edit/maniphest.custom-field-definitions/, enable the date fields, and remove their values, and file the task. Same behavior as on git master without the patch: These custom date values get set on the newly created task (which is not what I'd expect but it's not a regression created by this patch).
Reviewers: O1 Blessed Committers, slip, valerio.bozzolan
Reviewed By: O1 Blessed Committers, slip, valerio.bozzolan
Subscribers: slip, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno
Maniphest Tasks: T15994
Differential Revision: https://we.phorge.it/D25875