Skip to content

Commit

Permalink
Fix login link returnto issue on 1.18+
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Friesen committed Jan 1, 2012
1 parent 7d35a74 commit b6b605f
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions Monaco.skin.php
Expand Up @@ -743,15 +743,23 @@ private function getArticleLinks($tpl) {
*/
private function getUserLinks($tpl) {
wfProfileIn( __METHOD__ );
global $wgUser, $wgTitle;
global $wgUser, $wgTitle, $wgRequest;

$data = array();

if(!$wgUser->isLoggedIn()) {
$returnto = "returnto={$this->thisurl}";
if( $this->thisquery != '' )
$returnto .= "&returntoquery={$this->thisquery}";
$page = Title::newFromURL( $wgRequest->getVal( 'title', '' ) );
$page = $wgRequest->getVal( 'returnto', $page );
$a = array();
if ( strval( $page ) !== '' ) {
$a['returnto'] = $page;
$query = $wgRequest->getVal( 'returntoquery', $this->thisquery );
if( $query != '' ) {
$a['returntoquery'] = $query;
}
}
$returnto = wfArrayToCGI( $a );

if(!$wgUser->isLoggedIn()) {
$signUpHref = Skin::makeSpecialUrl( 'UserLogin', $returnto );
$data['login'] = array(
'text' => wfMsg('login'),
Expand Down

0 comments on commit b6b605f

Please sign in to comment.