From: Ilmari Karonen Date: Sat, 10 Apr 2010 23:46:58 +0000 (+0000) Subject: fix fatal error in Special:Preferences if $wgDefaultUserOptions['date'] is not valid... X-Git-Tag: 1.31.0-rc.0~37153 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/voir.php?a=commitdiff_plain;h=181acca65414cb928abda205c69c394c911dfb68;p=lhc%2Fweb%2Fwiklou.git fix fatal error in Special:Preferences if $wgDefaultUserOptions['date'] is not valid for the user's interface language --- 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();