From 122f5ddb64f810c2d321d2a2cc0a18183f31520e Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Thu, 21 Jul 2011 18:22:45 +0000 Subject: [PATCH] Address fixme on r86697: simplify the code a lot by not escaping thisquery and killing thisurl in favor of thispage. Per CR comments these vars aren't used anywhere else. I grepped phase3/includes , phase3/skins and extensions/ to confirm. --- includes/SkinTemplate.php | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 702e6aeffc..aa044458e2 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -157,7 +157,6 @@ class SkinTemplate extends Skin { wfProfileIn( __METHOD__ . '-stuff' ); $this->thispage = $this->getTitle()->getPrefixedDBkey(); - $this->thisurl = $this->getTitle()->getPrefixedURL(); $query = array(); if ( !$wgRequest->wasPosted() ) { $query = $wgRequest->getValues(); @@ -165,7 +164,7 @@ class SkinTemplate extends Skin { unset( $query['returnto'] ); unset( $query['returntoquery'] ); } - $this->thisquery = wfUrlencode( wfArrayToCGI( $query ) ); + $this->thisquery = wfArrayToCGI( $query ); $this->loggedin = $wgUser->isLoggedIn(); $this->iscontent = ( $this->getTitle()->getNamespace() != NS_SPECIAL ); $this->iseditable = ( $this->iscontent and !( $action == 'edit' or $action == 'submit' ) ); @@ -565,27 +564,13 @@ class SkinTemplate extends Skin { /* set up the default links for the personal toolbar */ $personal_urls = array(); - // Get the returnto and returntoquery parameters from the query string - // or fall back on $this->thisurl or $this->thisquery - // We can't use getVal()'s default value feature here because - // stuff from $wgRequest needs to be escaped, but thisurl and thisquery - // are already escaped. - $page = $wgRequest->getVal( 'returnto' ); - if ( !is_null( $page ) ) { - $page = wfUrlencode( $page ); - } else { - $page = $this->thisurl; - } - $query = $wgRequest->getVal( 'returntoquery' ); - if ( !is_null( $query ) ) { - $query = wfUrlencode( $query ); - } else { - $query = $this->thisquery; - } - $returnto = "returnto=$page"; + $page = $wgRequest->getVal( 'returnto', $this->thispage ); + $query = $wgRequest->getVal( 'returntoquery', $this->thisquery ); + $a = array( 'returnto' => $page ); if( $query != '' ) { - $returnto .= "&returntoquery=$query"; + $a['returntoquery'] = $query; } + $returnto = wfArrayToCGI( $a ); if( $this->loggedin ) { $personal_urls['userpage'] = array( 'text' => $this->username, -- 2.20.1