(bug 2650) Fix national date type display on wikis that don't support dynamic date...
authorJens Frank <jeluf@users.mediawiki.org>
Sun, 3 Jul 2005 07:26:10 +0000 (07:26 +0000)
committerJens Frank <jeluf@users.mediawiki.org>
Sun, 3 Jul 2005 07:26:10 +0000 (07:26 +0000)
RELEASE-NOTES
includes/SpecialPreferences.php
languages/Language.php

index 3ff21a1..6e5e23c 100644 (file)
@@ -452,6 +452,8 @@ of MediaWiki:Newpagetext) to &action=edit, if page is new.
   image description pages when viewed on local wikis.
 * Restore compatibility namespace aliases for French Wikipedia
 * Fix diff order on Enhanced RC 'changes' link
+* (bug 2650) Fix national date type display on wikis that don't support
+  dynamic date conversion.
 
 
 === Caveats ===
index 95f16e0..90b2125 100644 (file)
@@ -214,7 +214,7 @@ class PreferencesForm {
                if( $wgUseTeX ) {
                        $wgUser->setOption( 'math', $this->mMath );
                }
-               $wgUser->setOption( 'date', $this->mDate );
+               $wgUser->setOption( 'date', $this->validateInt( $this->mDate, 0, 10 ) );
                $wgUser->setOption( 'searchlimit', $this->validateIntOrNull( $this->mSearch ) );
                $wgUser->setOption( 'contextlines', $this->validateIntOrNull( $this->mSearchLines ) );
                $wgUser->setOption( 'contextchars', $this->validateIntOrNull( $this->mSearchChars ) );
index 5409d26..1cde939 100644 (file)
@@ -2428,8 +2428,9 @@ class Language {
                if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); }
 
                $datePreference = $this->dateFormat($format);
-
-               if ($datePreference == '0') {$datePreference = $wgAmericanDates ? '0' : '2';}
+               
+               if ($datePreference == '0'
+                   || $datePreference == '' ) {$datePreference = $wgAmericanDates ? '0' : '2';}
 
                $month = $this->getMonthName( substr( $ts, 4, 2 ) );
                $day = $this->formatNum( 0 + substr( $ts, 6, 2 ) );