From: Tim Starling Date: Thu, 1 Apr 2004 12:53:01 +0000 (+0000) Subject: use of $wgRequest X-Git-Tag: 1.3.0beta1~656 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_add%27%29%20%7D%7D?a=commitdiff_plain;h=68967f0f0088723343ed645760ce804003035b50;p=lhc%2Fweb%2Fwiklou.git use of $wgRequest --- diff --git a/includes/SpecialAllpages.php b/includes/SpecialAllpages.php index 54b64422a5..e4187567da 100644 --- a/includes/SpecialAllpages.php +++ b/includes/SpecialAllpages.php @@ -2,12 +2,13 @@ function wfSpecialAllpages( $par=NULL ) { - global $from, $indexMaxperpage; + global $indexMaxperpage, $wgRequest; $indexMaxperpage = 480; + $from = $wgRequest->getVal( 'from' ); if( $par ) { indexShowChunk( $par ); - } elseif( isset( $from ) ) { + } elseif( !is_null( $from ) ) { indexShowChunk( $from ); } else { indexShowToplevel(); diff --git a/includes/SpecialCategories.php b/includes/SpecialCategories.php index 0b145ef605..950cf4ed4e 100644 --- a/includes/SpecialCategories.php +++ b/includes/SpecialCategories.php @@ -2,8 +2,8 @@ function wfSpecialCategories() { - global $wgUser, $wgOut , $wgLang ; - global $article , $category ; + global $wgUser, $wgOut , $wgLang; + $sk = $wgUser->getSkin() ; $sc = "Special:Categories" ; $r = "" ; diff --git a/includes/SpecialContributions.php b/includes/SpecialContributions.php index 6c954a301f..0bc00f6917 100644 --- a/includes/SpecialContributions.php +++ b/includes/SpecialContributions.php @@ -149,7 +149,7 @@ TODO: This would probably look a lot nicer in a table. */ function ucListEdit( $sk, $ns, $t, $ts, $topmark, $comment, $isminor, $isnew ) { - global $wgLang, $wgOut, $wgUser, $wgRequest, $target; + global $wgLang, $wgOut, $wgUser, $wgRequest; $page = Title::makeName( $ns, $t ); $link = $sk->makeKnownLink( $page, "" ); $topmarktext=""; @@ -162,6 +162,7 @@ function ucListEdit( $sk, $ns, $t, $ts, $topmark, $comment, $isminor, $isnew ) $sysop = $wgUser->isSysop(); if($sysop ) { $extraRollback = $wgRequest->getBool( "bot" ) ? '&bot=1' : ''; + $target = $wgRequest->getText( 'target' ); $topmarktext .= " [". $sk->makeKnownLink( $page, wfMsg( "rollbacklink" ), "action=rollback&from=" . urlencode( $target ) . $extraRollback ) ."]"; @@ -188,8 +189,9 @@ function ucListEdit( $sk, $ns, $t, $ts, $topmark, $comment, $isminor, $isnew ) function ucCountLink( $lim, $d ) { - global $wgUser, $wgLang, $target; + global $wgUser, $wgLang, $wgRequest; + $target = $wgRequest->getText( 'target' ); $sk = $wgUser->getSkin(); $s = $sk->makeKnownLink( $wgLang->specialPage( "Contributions" ), "{$lim}", "target={$target}&days={$d}&limit={$lim}" ); @@ -198,8 +200,9 @@ function ucCountLink( $lim, $d ) function ucDaysLink( $lim, $d ) { - global $wgUser, $wgLang, $target; + global $wgUser, $wgLang, $wgRequest; + $target = $wgRequest->getText( 'target' ); $sk = $wgUser->getSkin(); $s = $sk->makeKnownLink( $wgLang->specialPage( "Contributions" ), "{$d}", "target={$target}&days={$d}&limit={$lim}" ); diff --git a/includes/SpecialEmailuser.php b/includes/SpecialEmailuser.php index c1a071f9e4..2d9645dec0 100644 --- a/includes/SpecialEmailuser.php +++ b/includes/SpecialEmailuser.php @@ -11,8 +11,8 @@ function wfSpecialEmailuser() $wgOut->errorpage( "mailnologin", "mailnologintext" ); return; } - $action = $wgRequest->getVal( $action ); - $target = $wgRequest->getVal( $target ); + $action = $wgRequest->getVal( 'action' ); + $target = $wgRequest->getVal( 'target' ); if ( "" == $target ) { $wgOut->errorpage( "notargettitle", "notargettext" ); return; @@ -59,12 +59,13 @@ class EmailUserForm { function showForm( $err ) { global $wgOut, $wgUser, $wgLang; - global $wpSubject, $wpText; $wgOut->setPagetitle( wfMsg( "emailpage" ) ); $wgOut->addWikiText( wfMsg( "emailpagetext" ) ); - if ( ! $wpSubject ) { $wpSubject = wfMsg( "defemailsubject" ); } + if ( $this->subject === "" ) { + $this->subject = wfMsg( "defemailsubject" ); + } $emf = wfMsg( "emailfrom" ); $sender = $wgUser->getName(); @@ -73,7 +74,8 @@ class EmailUserForm { $emr = wfMsg( "emailsubject" ); $emm = wfMsg( "emailmessage" ); $ems = wfMsg( "emailsend" ); - + $encSubject = htmlspecialchars( $this->subject ); + $titleObj = Title::makeTitle( NS_SPECIAL, "Emailuser" ); $action = $titleObj->escapeLocalURL( "target={$this->target}&action=submit" ); @@ -92,13 +94,13 @@ class EmailUserForm { {$emr}: - + {$emm}:   @@ -111,16 +113,16 @@ class EmailUserForm { function doSubmit() { global $wgOut, $wgUser, $wgLang, $wgOutputEncoding; - global $wpSubject, $wpText, $this->target; $from = wfQuotedPrintable( $wgUser->getName() ) . " <" . $wgUser->getEmail() . ">"; - $mailResult = userMailer( $this->mAddress, $from, wfQuotedPrintable( $wpSubject ), $wpText ); + $mailResult = userMailer( $this->mAddress, $from, wfQuotedPrintable( $this->subject ), $this->text ); if (! $mailResult) { $titleObj = Title::makeTitle( NS_SPECIAL, "Emailuser" ); - $wgOut->redirect( $titleObj->getFullURL( "target={$this->target}&action=success" ) ); + $encTarget = wfUrlencode( $this->target ); + $wgOut->redirect( $titleObj->getFullURL( "target={$encTarget}&action=success" ) ); } else $wgOut->addHTML( wfMsg( "usermailererror" ) . $mailResult); diff --git a/includes/SpecialIpblocklist.php b/includes/SpecialIpblocklist.php index 7d16f4826d..30fd5833fc 100644 --- a/includes/SpecialIpblocklist.php +++ b/includes/SpecialIpblocklist.php @@ -2,10 +2,11 @@ function wfSpecialIpblocklist() { - global $wgUser, $wgOut, $wgRequest, $action; + global $wgUser, $wgOut, $wgRequest; $ip = $wgRequest->getVal( 'wpUnblockAddress', $wgRequest->getVal( 'ip' ) ); $reason = $wgRequest->getText( 'wpUnblockReason' ); + $action = $wgRequest->getText( 'action' ); $ipu = new IPUnblockForm( $ip, $reason ); diff --git a/includes/SpecialLockdb.php b/includes/SpecialLockdb.php index 435a8dde29..ff26cc3855 100644 --- a/includes/SpecialLockdb.php +++ b/includes/SpecialLockdb.php @@ -2,13 +2,13 @@ function wfSpecialLockdb() { - global $wgUser, $wgOut, $wgRequest, $action; + global $wgUser, $wgOut, $wgRequest; if ( ! $wgUser->isDeveloper() ) { $wgOut->developerRequired(); return; } - + $action = $wgRequest->getText( 'action' ); $f = new DBLockForm(); if ( "success" == $action ) { $f->showSuccess(); } @@ -27,7 +27,6 @@ class DBLockForm { function showForm( $err ) { global $wgOut, $wgUser, $wgLang; - global $wpLockConfirm; $wgOut->setPagetitle( wfMsg( "lockdb" ) ); $wgOut->addWikiText( wfMsg( "lockdbtext" ) ); diff --git a/includes/SpecialRandompage.php b/includes/SpecialRandompage.php index d55f6434ff..a442623f1b 100644 --- a/includes/SpecialRandompage.php +++ b/includes/SpecialRandompage.php @@ -2,7 +2,7 @@ function wfSpecialRandompage() { - global $wgOut, $wgTitle, $wgArticle, $force; + global $wgOut, $wgTitle, $wgArticle; $fname = "wfSpecialRandompage"; wfSeedRandom(); diff --git a/includes/SpecialRecentchangeslinked.php b/includes/SpecialRecentchangeslinked.php index 1a505885f1..afe39ced70 100644 --- a/includes/SpecialRecentchangeslinked.php +++ b/includes/SpecialRecentchangeslinked.php @@ -3,10 +3,13 @@ include_once( "SpecialRecentchanges.php" ); function wfSpecialRecentchangeslinked( $par = NULL ) { - global $wgUser, $wgOut, $wgLang, $wgTitle; - global $days, $target, $hideminor; # From query string + global $wgUser, $wgOut, $wgLang, $wgTitle, $wgRequest; $fname = "wfSpecialRecentchangeslinked"; + $days = $wgRequest->getInt( 'days' ); + $target = $wgRequest->getText( 'target' ); + $hideminor = $wgRequest->getBool( 'hideminor' ) ? 1 : 0; + $wgOut->setPagetitle( wfMsg( "recentchanges" ) ); $sk = $wgUser->getSkin(); diff --git a/includes/SpecialUnlockdb.php b/includes/SpecialUnlockdb.php index b7ef19b4cd..589f89ffca 100644 --- a/includes/SpecialUnlockdb.php +++ b/includes/SpecialUnlockdb.php @@ -2,12 +2,13 @@ function wfSpecialUnlockdb() { - global $wgUser, $wgOut, $action; + global $wgUser, $wgOut, $wgRequest; if ( ! $wgUser->isDeveloper() ) { $wgOut->developerRequired(); return; } + $action = $wgRequest->getText( 'action' ); $f = new DBUnlockForm(); if ( "success" == $action ) { $f->showSuccess(); } @@ -16,11 +17,9 @@ function wfSpecialUnlockdb() } class DBUnlockForm { - function showForm( $err ) { global $wgOut, $wgUser, $wgLang; - global $wpLockConfirm; $wgOut->setPagetitle( wfMsg( "unlockdb" ) ); $wgOut->addWikiText( wfMsg( "unlockdbtext" ) ); @@ -52,8 +51,9 @@ class DBUnlockForm { function doSubmit() { global $wgOut, $wgUser, $wgLang; - global $wpLockConfirm, $wgReadOnlyFile; + global $wgRequest, $wgReadOnlyFile; + $wpLockConfirm = $wgRequest->getCheck( 'wpLockConfirm' ); if ( ! $wpLockConfirm ) { $this->showForm( wfMsg( "locknoconfirm" ) ); return; diff --git a/includes/SpecialUnusedimages.php b/includes/SpecialUnusedimages.php index fb94bcc836..5f05a3144f 100644 --- a/includes/SpecialUnusedimages.php +++ b/includes/SpecialUnusedimages.php @@ -3,7 +3,6 @@ function wfSpecialUnusedimages() { global $wgUser, $wgOut, $wgLang, $wgTitle; - global $limit, $offset; # From query string $fname = "wfSpecialUnusedimages"; list( $limit, $offset ) = wfCheckLimits();