Index: trunk/extensions/OpenID/OpenID.hooks.php |
— | — | @@ -5,7 +5,7 @@ |
6 | 6 | global $wgOpenIDOnly, $wgOpenIDClientOnly; |
7 | 7 | |
8 | 8 | if ( $wgOpenIDOnly ) { |
9 | | - $list['Userlogin'] = array( 'SpecialRedirectToSpecial', 'Userlogin', 'OpenIDLogin', false, array('returnto') ); |
| 9 | + $list['Userlogin'] = array( 'SpecialRedirectToSpecial', 'Userlogin', 'OpenIDLogin', false, array( 'returnto', 'returntoquery' ) ); |
10 | 10 | # Used in 1.12.x and above |
11 | 11 | $list['CreateAccount'] = array( 'SpecialRedirectToSpecial', 'CreateAccount', 'OpenIDLogin' ); |
12 | 12 | } |
Index: trunk/extensions/OpenID/SpecialOpenIDLogin.body.php |
— | — | @@ -63,7 +63,7 @@ |
64 | 64 | |
65 | 65 | default: # Main entry point |
66 | 66 | if ( $wgRequest->getText( 'returnto' ) ) { |
67 | | - $this->setReturnTo( $wgRequest->getText( 'returnto' ) ); |
| 67 | + $this->setReturnTo( $wgRequest->getText( 'returnto' ), $wgRequest->getVal( 'returntoquery' ) ); |
68 | 68 | } |
69 | 69 | |
70 | 70 | $openid_url = $wgRequest->getText( 'openid_url' ); |
— | — | @@ -86,7 +86,8 @@ |
87 | 87 | $wgOut->setRobotPolicy( 'noindex,nofollow' ); |
88 | 88 | $wgOut->setArticleRelated( false ); |
89 | 89 | $wgOut->addWikiMsg( 'openidalreadyloggedin', $wgUser->getName() ); |
90 | | - $wgOut->returnToMain( false, $this->returnTo() ); |
| 90 | + list( $returnto, $returntoquery ) = $this->returnTo(); |
| 91 | + $wgOut->returnToMain( false, $returnto, $returntoquery ); |
91 | 92 | } |
92 | 93 | |
93 | 94 | /** |
— | — | @@ -490,7 +491,8 @@ |
491 | 492 | $wgOut->setArticleRelated( false ); |
492 | 493 | $wgOut->addWikiMsg( 'openidsuccess', $wgUser->getName(), $openid ); |
493 | 494 | $wgOut->addHtml( $inject_html ); |
494 | | - $wgOut->returnToMain( false, $this->returnTo() ); |
| 495 | + list( $returnto, $returntoquery ) = $this->returnTo(); |
| 496 | + $wgOut->returnToMain( false, $returnto, $returntoquery ); |
495 | 497 | } |
496 | 498 | |
497 | 499 | function createUser( $openid, $sreg, $name ) { |
— | — | @@ -697,10 +699,13 @@ |
698 | 700 | } |
699 | 701 | |
700 | 702 | 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 ); |
702 | 706 | } |
703 | 707 | |
704 | | - function setReturnTo( $returnto ) { |
| 708 | + function setReturnTo( $returnto, $returntoquery ) { |
705 | 709 | $_SESSION['openid_consumer_returnto'] = $returnto; |
| 710 | + $_SESSION['openid_consumer_returntoquery'] = $returntoquery; |
706 | 711 | } |
707 | 712 | } |