From: Bryan Tong Minh Date: Sat, 29 Jan 2011 21:42:03 +0000 (+0000) Subject: (bug 27021) Session key was changed somewhere from an int to a string, which broke... X-Git-Tag: 1.31.0-rc.0~32302 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=2b0fe5866b62988f34667c08ef53dbbe3ed51a38;p=lhc%2Fweb%2Fwiklou.git (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. --- diff --git a/includes/upload/UploadFromStash.php b/includes/upload/UploadFromStash.php index 23957bb6fd..7f0f92ef14 100644 --- a/includes/upload/UploadFromStash.php +++ b/includes/upload/UploadFromStash.php @@ -19,7 +19,7 @@ class UploadFromStash extends UploadBase { public static function isValidRequest( $request ) { $sessionData = $request->getSessionData( UploadBase::SESSION_KEYNAME ); return self::isValidSessionKey( - $request->getInt( 'wpSessionKey' ), + $request->getText( 'wpSessionKey' ), $sessionData ); } @@ -46,7 +46,7 @@ class UploadFromStash extends UploadBase { } public function initializeFromRequest( &$request ) { - $sessionKey = $request->getInt( 'wpSessionKey' ); + $sessionKey = $request->getText( 'wpSessionKey' ); $sessionData = $request->getSessionData( UploadBase::SESSION_KEYNAME ); $desiredDestName = $request->getText( 'wpDestFile' );