* Special:Allpages, Special:Contributions, Special:Whatlinkshere
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Fri, 6 May 2005 11:20:37 +0000 (11:20 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Fri, 6 May 2005 11:20:37 +0000 (11:20 +0000)
  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.

includes/SpecialContributions.php
includes/SpecialEmailuser.php
includes/SpecialRecentchangeslinked.php
includes/SpecialWhatlinkshere.php

index 78ba1a1..cabb915 100644 (file)
  * @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' );
index 9c53a71..2e667d5 100644 (file)
@@ -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" );
index 37516fc..86ec1b9 100644 (file)
@@ -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;
        }
index 8b363b8..ac1dec0 100644 (file)
@@ -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;
        }