r81197 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81196‎ | r81197 | r81198 >
Date:21:42, 29 January 2011
Author:btongminh
Status:ok (Comments)
Tags:
Comment:
(bug 27021) Session key was changed somewhere from an int to a string, which broke stashed uploads totally. Changed $wgRequest->getInt to $wgRequest->getText. The API never explicitly defined it as int, so should not be affected.
Note that this also may break API clients in certain cases for strongly, statically typed languages (e.g. int sessionKey = request->sessionKey;). I see no way around this, so I will announce a breaking change on the API mailing list shortly.
Modified paths:
  • /trunk/phase3/includes/upload/UploadFromStash.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/upload/UploadFromStash.php
@@ -19,7 +19,7 @@
2020 public static function isValidRequest( $request ) {
2121 $sessionData = $request->getSessionData( UploadBase::SESSION_KEYNAME );
2222 return self::isValidSessionKey(
23 - $request->getInt( 'wpSessionKey' ),
 23+ $request->getText( 'wpSessionKey' ),
2424 $sessionData
2525 );
2626 }
@@ -46,7 +46,7 @@
4747 }
4848
4949 public function initializeFromRequest( &$request ) {
50 - $sessionKey = $request->getInt( 'wpSessionKey' );
 50+ $sessionKey = $request->getText( 'wpSessionKey' );
5151 $sessionData = $request->getSessionData( UploadBase::SESSION_KEYNAME );
5252
5353 $desiredDestName = $request->getText( 'wpDestFile' );

Follow-up revisions

RevisionCommit summaryAuthorDate
r814111.17: MFT r81186, r81187, r81197, r81209, r81210, r81211, r81215, r81238, r81...catrope20:23, 2 February 2011

Comments

#Comment by Bryan (talk | contribs)   21:43, 29 January 2011

The 1.17 backport needs the following entry in the RELEASE-NOTES under the API section:

  • Session keys returned by ApiUpload are now strings instead of integers

Status & tagging log