From: Bartosz DziewoƄski Date: Wed, 14 Nov 2018 14:49:22 +0000 (+0100) Subject: LogEventsList: Don't output '0000-00-00' as default date X-Git-Tag: 1.34.0-rc.0~3515^2 X-Git-Url: https://git.cyclocoop.org/admin/%7B%24admin_url%7Dmembres/Zigzagzogzagzig?a=commitdiff_plain;h=6b328a5975fe953faa85c462c38fc963ca401993;p=lhc%2Fweb%2Fwiklou.git LogEventsList: Don't output '0000-00-00' as default date It is an invalid value that should be (by spec) ignored by the browser, but apparently some browsers don't ignore it, and when they submit it back, it is converted to -0001-11-30 by our date parsing. Bug: T209490 Change-Id: I2643767a0091c1c9db78706358903e1dc97b59d1 --- diff --git a/includes/logging/LogEventsList.php b/includes/logging/LogEventsList.php index a5aa6879e9..7317367be2 100644 --- a/includes/logging/LogEventsList.php +++ b/includes/logging/LogEventsList.php @@ -148,7 +148,7 @@ class LogEventsList extends ContextSource { $formDescriptor['date'] = [ 'type' => 'date', 'label-message' => 'date', - 'default' => sprintf( "%04d-%02d-%02d", $year, $month, $day ), + 'default' => $year && $month && $day ? sprintf( "%04d-%02d-%02d", $year, $month, $day ) : '', ]; // Tag filter