Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -164,6 +164,8 @@ |
165 | 165 | $this->thisurl = $this->mTitle->getPrefixedURL(); |
166 | 166 | $query = $wgRequest->getValues(); |
167 | 167 | unset( $query['title'] ); |
| 168 | + unset( $query['returnto'] ); |
| 169 | + unset( $query['returntoquery'] ); |
168 | 170 | $this->thisquery = wfUrlencode( wfArrayToCGI( $query ) ); |
169 | 171 | $this->loggedin = $wgUser->isLoggedIn(); |
170 | 172 | $this->iscontent = ( $this->mTitle->getNamespace() != NS_SPECIAL ); |
— | — | @@ -516,6 +518,11 @@ |
517 | 519 | |
518 | 520 | /* set up the default links for the personal toolbar */ |
519 | 521 | $personal_urls = array(); |
| 522 | + $page = $wgRequest->getVal( 'returnto', $this->thisurl ); |
| 523 | + $query = $wgRequest->getVal( 'returntoquery', $this->thisquery ); |
| 524 | + $returnto = "returnto=$page"; |
| 525 | + if( $this->thisquery != '' ) |
| 526 | + $returnto .= "&returntoquery=$query"; |
520 | 527 | if( $this->loggedin ) { |
521 | 528 | $personal_urls['userpage'] = array( |
522 | 529 | 'text' => $this->username, |
— | — | @@ -568,7 +575,7 @@ |
569 | 576 | $personal_urls['logout'] = array( |
570 | 577 | 'text' => wfMsg( 'userlogout' ), |
571 | 578 | 'href' => self::makeSpecialUrl( 'Userlogout', |
572 | | - $title->isSpecial( 'Preferences' ) ? '' : "returnto={$this->thisurl}&returntoquery={$this->thisquery}" |
| 579 | + $title->isSpecial( 'Preferences' ) ? '' : $returnto |
573 | 580 | ), |
574 | 581 | 'active' => false |
575 | 582 | ); |
— | — | @@ -595,13 +602,13 @@ |
596 | 603 | ); |
597 | 604 | $personal_urls['anonlogin'] = array( |
598 | 605 | 'text' => wfMsg( $loginlink ), |
599 | | - 'href' => self::makeSpecialUrl( 'Userlogin', "returnto={$this->thisurl}&returntoquery={$this->thisquery}" ), |
| 606 | + 'href' => self::makeSpecialUrl( 'Userlogin', $returnto ), |
600 | 607 | 'active' => $title->isSpecial( 'Userlogin' ) |
601 | 608 | ); |
602 | 609 | } else { |
603 | 610 | $personal_urls['login'] = array( |
604 | 611 | 'text' => wfMsg( $loginlink ), |
605 | | - 'href' => self::makeSpecialUrl( 'Userlogin', "returnto={$this->thisurl}&returntoquery={$this->thisquery}" ), |
| 612 | + 'href' => self::makeSpecialUrl( 'Userlogin', $returnto ), |
606 | 613 | 'active' => $title->isSpecial( 'Userlogin' ) |
607 | 614 | ); |
608 | 615 | } |