r60239 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60238‎ | r60239 | r60240 >
Date:14:57, 20 December 2009
Author:ialex
Status:deferred
Tags:
Comment:
Follow-up r59807: let's also use the "returntoquery" parameter
Modified paths:
  • /trunk/extensions/OpenID/OpenID.hooks.php (modified) (history)
  • /trunk/extensions/OpenID/SpecialOpenIDLogin.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenID/OpenID.hooks.php
@@ -5,7 +5,7 @@
66 global $wgOpenIDOnly, $wgOpenIDClientOnly;
77
88 if ( $wgOpenIDOnly ) {
9 - $list['Userlogin'] = array( 'SpecialRedirectToSpecial', 'Userlogin', 'OpenIDLogin', false, array('returnto') );
 9+ $list['Userlogin'] = array( 'SpecialRedirectToSpecial', 'Userlogin', 'OpenIDLogin', false, array( 'returnto', 'returntoquery' ) );
1010 # Used in 1.12.x and above
1111 $list['CreateAccount'] = array( 'SpecialRedirectToSpecial', 'CreateAccount', 'OpenIDLogin' );
1212 }
Index: trunk/extensions/OpenID/SpecialOpenIDLogin.body.php
@@ -63,7 +63,7 @@
6464
6565 default: # Main entry point
6666 if ( $wgRequest->getText( 'returnto' ) ) {
67 - $this->setReturnTo( $wgRequest->getText( 'returnto' ) );
 67+ $this->setReturnTo( $wgRequest->getText( 'returnto' ), $wgRequest->getVal( 'returntoquery' ) );
6868 }
6969
7070 $openid_url = $wgRequest->getText( 'openid_url' );
@@ -86,7 +86,8 @@
8787 $wgOut->setRobotPolicy( 'noindex,nofollow' );
8888 $wgOut->setArticleRelated( false );
8989 $wgOut->addWikiMsg( 'openidalreadyloggedin', $wgUser->getName() );
90 - $wgOut->returnToMain( false, $this->returnTo() );
 90+ list( $returnto, $returntoquery ) = $this->returnTo();
 91+ $wgOut->returnToMain( false, $returnto, $returntoquery );
9192 }
9293
9394 /**
@@ -490,7 +491,8 @@
491492 $wgOut->setArticleRelated( false );
492493 $wgOut->addWikiMsg( 'openidsuccess', $wgUser->getName(), $openid );
493494 $wgOut->addHtml( $inject_html );
494 - $wgOut->returnToMain( false, $this->returnTo() );
 495+ list( $returnto, $returntoquery ) = $this->returnTo();
 496+ $wgOut->returnToMain( false, $returnto, $returntoquery );
495497 }
496498
497499 function createUser( $openid, $sreg, $name ) {
@@ -697,10 +699,13 @@
698700 }
699701
700702 function returnTo() {
701 - return isset( $_SESSION['openid_consumer_returnto'] ) ? $_SESSION['openid_consumer_returnto'] : '';
 703+ $returnto = isset( $_SESSION['openid_consumer_returnto'] ) ? $_SESSION['openid_consumer_returnto'] : '';
 704+ $returntoquery = isset( $_SESSION['openid_consumer_returntoquery'] ) ? $_SESSION['openid_consumer_returntoquery'] : '';
 705+ return array( $returnto, $returntoquery );
702706 }
703707
704 - function setReturnTo( $returnto ) {
 708+ function setReturnTo( $returnto, $returntoquery ) {
705709 $_SESSION['openid_consumer_returnto'] = $returnto;
 710+ $_SESSION['openid_consumer_returntoquery'] = $returntoquery;
706711 }
707712 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r59807Applied patch for dropped returnto in $wgOpenIDOnly case (bug 21661)sergeychernyshev23:10, 7 December 2009

Status & tagging log