From: Ævar Arnfjörð Bjarmason Date: Fri, 6 May 2005 11:20:37 +0000 (+0000) Subject: * Special:Allpages, Special:Contributions, Special:Whatlinkshere X-Git-Tag: 1.5.0alpha2~287 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=1ec4bb98904353a911f6e4e3ff57c754cbe381d6;p=lhc%2Fweb%2Fwiklou.git * Special:Allpages, Special:Contributions, Special:Whatlinkshere Special:Recentchangeslinked and Special:Emailuser all mishandled being passed "0" with the Special:Page/0 syntax (unrelated to bug 2087), this either required a workaround in the form of passing "0" as a GET value or blocked the user from passing that value at all. --- diff --git a/includes/SpecialContributions.php b/includes/SpecialContributions.php index 78ba1a1f41..cabb915cf3 100644 --- a/includes/SpecialContributions.php +++ b/includes/SpecialContributions.php @@ -11,12 +11,12 @@ * @return none * @param string $par (optional) user name of the user for which to show the contributions */ -function wfSpecialContributions( $par = '' ) { +function wfSpecialContributions( $par = null ) { global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest; $fname = 'wfSpecialContributions'; // GET values - $target = $par ? $par : $wgRequest->getVal( 'target' ); + $target = isset($par) ? $par : $wgRequest->getVal( 'target' ); $namespace = $wgRequest->getVal( 'namespace', '' ); $namespace = $namespace === '' ? NULL : $namespace; $invert = $wgRequest->getBool( 'invert' ); diff --git a/includes/SpecialEmailuser.php b/includes/SpecialEmailuser.php index 9c53a7148a..2e667d5e5e 100644 --- a/includes/SpecialEmailuser.php +++ b/includes/SpecialEmailuser.php @@ -25,11 +25,7 @@ function wfSpecialEmailuser( $par ) { } $action = $wgRequest->getVal( 'action' ); - if( empty( $par ) ) { - $target = $wgRequest->getVal( 'target' ); - } else { - $target = $par; - } + $target = isset($par) ? $par : $wgRequest->getVal( 'target' ); if ( "" == $target ) { wfDebug( "Target is empty.\n" ); $wgOut->errorpage( "notargettitle", "notargettext" ); diff --git a/includes/SpecialRecentchangeslinked.php b/includes/SpecialRecentchangeslinked.php index 37516fcb9e..86ec1b9ef7 100644 --- a/includes/SpecialRecentchangeslinked.php +++ b/includes/SpecialRecentchangeslinked.php @@ -19,16 +19,13 @@ function wfSpecialRecentchangeslinked( $par = NULL ) { $fname = 'wfSpecialRecentchangeslinked'; $days = $wgRequest->getInt( 'days' ); - $target = $wgRequest->getText( 'target' ); + $target = isset($par) ? $par : $wgRequest->getText( 'target' ); $hideminor = $wgRequest->getBool( 'hideminor' ) ? 1 : 0; $wgOut->setPagetitle( wfMsg( "recentchanges" ) ); $sk = $wgUser->getSkin(); - if( $par ) { - $target = $par; - } - if ( $target == '') { + if (is_null($target)) { $wgOut->errorpage( 'notargettitle', 'notargettext' ); return; } diff --git a/includes/SpecialWhatlinkshere.php b/includes/SpecialWhatlinkshere.php index 8b363b8339..ac1dec0e11 100644 --- a/includes/SpecialWhatlinkshere.php +++ b/includes/SpecialWhatlinkshere.php @@ -13,12 +13,10 @@ function wfSpecialWhatlinkshere($par = NULL) { global $wgUser, $wgOut, $wgRequest; $fname = 'wfSpecialWhatlinkshere'; - $target = $wgRequest->getVal( 'target' ); + $target = isset($par) ? $par : $wgRequest->getVal( 'target' ); list( $limit, $offset ) = $wgRequest->getLimitOffset(); - if(!empty($par)) { - $target = $par; - } else if ( is_null( $target ) ) { + if (is_null($target)) { $wgOut->errorpage( 'notargettitle', 'notargettext' ); return; }