r83714 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83713‎ | r83714 | r83715 >
Date:20:04, 11 March 2011
Author:ialex
Status:ok
Tags:
Comment:
Follow-up r83080: make ApiUploadTest really work this time
Modified paths:
  • /trunk/phase3/includes/User.php (modified) (history)
  • /trunk/phase3/includes/api/ApiLogin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -2457,9 +2457,15 @@
24582458
24592459 /**
24602460 * Set the default cookies for this session on the user's client.
 2461+ *
 2462+ * @param $request WebRequest object to use; $wgRequest will be used if null
 2463+ * is passed.
24612464 */
2462 - function setCookies() {
2463 - global $wgRequest;
 2465+ function setCookies( $request = null ) {
 2466+ if ( $request === null ) {
 2467+ global $wgRequest;
 2468+ $request = $wgRequest;
 2469+ }
24642470
24652471 $this->load();
24662472 if ( 0 == $this->mId ) return;
@@ -2481,7 +2487,7 @@
24822488 wfRunHooks( 'UserSetCookies', array( $this, &$session, &$cookies ) );
24832489
24842490 foreach ( $session as $name => $value ) {
2485 - $wgRequest->setSessionData( $name, $value );
 2491+ $request->setSessionData( $name, $value );
24862492 }
24872493 foreach ( $cookies as $name => $value ) {
24882494 if ( $value === false ) {
Index: trunk/phase3/includes/api/ApiLogin.php
@@ -75,7 +75,7 @@
7676 switch ( $authRes = $loginForm->authenticateUserData() ) {
7777 case LoginForm::SUCCESS:
7878 $wgUser->setOption( 'rememberpassword', 1 );
79 - $wgUser->setCookies();
 79+ $wgUser->setCookies( $this->getMain()->getRequest() );
8080
8181 // Run hooks. FIXME: split back and frontend from this hook.
8282 // FIXME: This hook should be placed in the backend

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r83080Per Platonides, fix for r82686: make ApiUploadTest work again...ialex12:52, 2 March 2011

Status & tagging log