From 181acca65414cb928abda205c69c394c911dfb68 Mon Sep 17 00:00:00 2001 From: Ilmari Karonen Date: Sat, 10 Apr 2010 23:46:58 +0000 Subject: [PATCH] fix fatal error in Special:Preferences if $wgDefaultUserOptions['date'] is not valid for the user's interface language --- RELEASE-NOTES | 2 ++ includes/Preferences.php | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d96407181e..ac35de51c8 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -99,6 +99,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 23078) "All public logs" option on Special:Log is now always the first item * (bug 16817) Group names in user rights log are now singular and in lowercase +* Special:Preferences no longer crashes if the wiki default date formatting + style is not valid for the user's interface language === API changes in 1.17 === * (bug 22738) Allow filtering by action type on query=logevent diff --git a/includes/Preferences.php b/includes/Preferences.php index eb5e1f9e14..fce0e260b4 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -1105,6 +1105,11 @@ class Preferences { $dateopts[] = 'default'; // Make sure default is always valid // Bug 19237 } + // KLUGE: site default might not be valid for user language + global $wgDefaultUserOptions; + if ( !in_array( $wgDefaultUserOptions['date'], $dateopts ) ) { + $wgDefaultUserOptions['date'] = 'default'; + } $idCnt = 0; $epoch = wfTimestampNow(); -- 2.20.1