(bug 11612) Days to show in recent changes cannot be larger than 7
authorRoan Kattouw <catrope@users.mediawiki.org>
Thu, 11 Oct 2007 12:31:46 +0000 (12:31 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Thu, 11 Oct 2007 12:31:46 +0000 (12:31 +0000)
RELEASE-NOTES
includes/SpecialPreferences.php

index f0a23a1..b7b4ff4 100644 (file)
@@ -97,6 +97,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 11620) Add call to User::isValidEmailAddr during accout creation.
 * (bug 11629) If $wgEmailConfirmToEdit is true, require people to supply an
   email address when registering.
+* (bug 11612) Days to show in recent changes cannot be larger than 7
 
 
 === API changes in 1.12 ===
index 851eda2..fb8c01a 100644 (file)
@@ -207,7 +207,7 @@ class PreferencesForm {
        function savePreferences() {
                global $wgUser, $wgOut, $wgParser;
                global $wgEnableUserEmail, $wgEnableEmail;
-               global $wgEmailAuthentication;
+               global $wgEmailAuthentication, $wgRCMaxAge;
                global $wgAuth, $wgEmailConfirmToEdit;
 
 
@@ -275,7 +275,7 @@ class PreferencesForm {
                $wgUser->setOption( 'contextlines', $this->validateIntOrNull( $this->mSearchLines ) );
                $wgUser->setOption( 'contextchars', $this->validateIntOrNull( $this->mSearchChars ) );
                $wgUser->setOption( 'rclimit', $this->validateIntOrNull( $this->mRecent ) );
-               $wgUser->setOption( 'rcdays', $this->validateInt( $this->mRecentDays, 1, 7 ) );
+               $wgUser->setOption( 'rcdays', $this->validateInt($this->mRecentDays, 1, ceil($wgRCMaxAge / (3600*24))));
                $wgUser->setOption( 'wllimit', $this->validateIntOrNull( $this->mWatchlistEdits, 0, 1000 ) );
                $wgUser->setOption( 'rows', $this->validateInt( $this->mRows, 4, 1000 ) );
                $wgUser->setOption( 'cols', $this->validateInt( $this->mCols, 4, 1000 ) );