From 2b8a1bb77ed45af7ab806877ed1bf08f42227304 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Tue, 17 Jun 2008 10:44:12 +0000 Subject: [PATCH] Some more tweaks to Special:Recentchanges: * Made User::getDefaultOption() static * Do not breaks wikis whitout any changes * fixed E_NOTICE: undefined variable SpecialRecentchanges::$par in SpecialRecentchanges::setup() --- includes/User.php | 6 ++---- includes/specials/Recentchanges.php | 10 ++++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/includes/User.php b/includes/User.php index 6bfc2abc42..ea5a49da97 100644 --- a/includes/User.php +++ b/includes/User.php @@ -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 { diff --git a/includes/specials/Recentchanges.php b/includes/specials/Recentchanges.php index 24761930a3..16904b9f47 100644 --- a/includes/specials/Recentchanges.php +++ b/includes/specials/Recentchanges.php @@ -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; } -- 2.20.1