From 871f30ee4fed42ffaac774a69c84e8d97c4fc5b5 Mon Sep 17 00:00:00 2001 From: Jens Frank Date: Sun, 3 Jul 2005 07:26:10 +0000 Subject: [PATCH] (bug 2650) Fix national date type display on wikis that don't support dynamic date conversion. --- RELEASE-NOTES | 2 ++ includes/SpecialPreferences.php | 2 +- languages/Language.php | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 3ff21a18e3..6e5e23c4b9 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index 95f16e0012..90b2125975 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -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 ) ); diff --git a/languages/Language.php b/languages/Language.php index 5409d26107..1cde939295 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -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 ) ); -- 2.20.1