Some more tweaks to Special:Recentchanges:
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 17 Jun 2008 10:44:12 +0000 (10:44 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 17 Jun 2008 10:44:12 +0000 (10:44 +0000)
* Made User::getDefaultOption() static
* Do not breaks wikis whitout any changes
* fixed E_NOTICE: undefined variable SpecialRecentchanges::$par in SpecialRecentchanges::setup()

includes/User.php
includes/specials/Recentchanges.php

index 6bfc2ab..ea5a49d 100644 (file)
@@ -962,11 +962,9 @@ class User {
         *
         * @param string $opt
         * @return string
-        * @static
-        * @public
         */
-       function getDefaultOption( $opt ) {
-               $defOpts = User::getDefaultOptions();
+       public static function getDefaultOption( $opt ) {
+               $defOpts = self::getDefaultOptions();
                if( isset( $defOpts[$opt] ) ) {
                        return $defOpts[$opt];
                } else {
index 2476193..16904b9 100644 (file)
@@ -11,12 +11,10 @@ class SpecialRecentChanges extends SpecialPage {
        }
 
        public function getDefaultOptions() {
-               global $wgUser;
-
                $opts = new FormOptions();
 
-               $opts->add( 'days',  (int)$wgUser->getDefaultOption('rcdays') );
-               $opts->add( 'limit', (int)$wgUser->getDefaultOption('rclimit') );
+               $opts->add( 'days',  (int)User::getDefaultOption( 'rcdays' ) );
+               $opts->add( 'limit', (int)User::getDefaultOption( 'rclimit' ) );
                $opts->add( 'from', '' );
 
                $opts->add( 'hideminor',     false );
@@ -46,7 +44,7 @@ class SpecialRecentChanges extends SpecialPage {
 
                // Give precedence to subpage syntax
                if ( $parameters !== null ) {
-                       $this->parseParameters( $this->par, $opts );
+                       $this->parseParameters( $parameters, $opts );
                }
 
                $opts->validateIntBounds( 'limit', 0, 5000 );
@@ -69,7 +67,7 @@ class SpecialRecentChanges extends SpecialPage {
                $wgOut->setSquidMaxage( 10 );
 
                $lastmod = $this->checkLastModified( $feedFormat );
-               if ( !$lastmod ) {
+               if( $lastmod === false ){
                        return;
                }