http://www.mediawiki.org/wiki/Special:Code/MediaWiki/64915

Revision: 64915
Author:   vyznev
Date:     2010-04-10 23:46:58 +0000 (Sat, 10 Apr 2010)

Log Message:
-----------
fix fatal error in Special:Preferences if $wgDefaultUserOptions['date'] is not 
valid for the user's interface language

Modified Paths:
--------------
    trunk/phase3/RELEASE-NOTES
    trunk/phase3/includes/Preferences.php

Modified: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES  2010-04-10 22:05:19 UTC (rev 64914)
+++ trunk/phase3/RELEASE-NOTES  2010-04-10 23:46:58 UTC (rev 64915)
@@ -99,6 +99,8 @@
 * (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

Modified: trunk/phase3/includes/Preferences.php
===================================================================
--- trunk/phase3/includes/Preferences.php       2010-04-10 22:05:19 UTC (rev 
64914)
+++ trunk/phase3/includes/Preferences.php       2010-04-10 23:46:58 UTC (rev 
64915)
@@ -1105,6 +1105,11 @@
                                $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();



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to