From 6b328a5975fe953faa85c462c38fc963ca401993 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Wed, 14 Nov 2018 15:49:22 +0100 Subject: [PATCH] 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 --- includes/logging/LogEventsList.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.20.1