From 2b0fe5866b62988f34667c08ef53dbbe3ed51a38 Mon Sep 17 00:00:00 2001 From: Bryan Tong Minh Date: Sat, 29 Jan 2011 21:42:03 +0000 Subject: [PATCH] (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. --- includes/upload/UploadFromStash.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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' ); -- 2.20.1