fix fatal error in Special:Preferences if $wgDefaultUserOptions['date'] is not valid...
authorIlmari Karonen <vyznev@users.mediawiki.org>
Sat, 10 Apr 2010 23:46:58 +0000 (23:46 +0000)
committerIlmari Karonen <vyznev@users.mediawiki.org>
Sat, 10 Apr 2010 23:46:58 +0000 (23:46 +0000)
RELEASE-NOTES
includes/Preferences.php

index d964071..ac35de5 100644 (file)
@@ -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
index eb5e1f9..fce0e26 100644 (file)
@@ -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();