Index: branches/REL1_16/phase3/includes/upload/UploadFromStash.php |
— | — | @@ -24,10 +24,8 @@ |
25 | 25 | $sessionData |
26 | 26 | ); |
27 | 27 | } |
28 | | - /* |
29 | | - * some $na vars for uploadBase method compatibility. |
30 | | - */ |
31 | | - public function initialize( $name, $sessionData, $na=false, $na2=false ) { |
| 28 | + |
| 29 | + public function initialize( $name, $sessionKey, $sessionData ) { |
32 | 30 | /** |
33 | 31 | * Confirming a temporarily stashed upload. |
34 | 32 | * We don't want path names to be forged, so we keep |
— | — | @@ -40,19 +38,20 @@ |
41 | 39 | $sessionData['mFileSize'], |
42 | 40 | false |
43 | 41 | ); |
44 | | - |
| 42 | + |
| 43 | + $this->mSessionKey = $sessionKey; |
45 | 44 | $this->mVirtualTempPath = $sessionData['mTempPath']; |
46 | 45 | $this->mFileProps = $sessionData['mFileProps']; |
47 | 46 | } |
48 | 47 | |
49 | 48 | public function initializeFromRequest( &$request ) { |
50 | | - $this->mSessionKey = $request->getInt( 'wpSessionKey' ); |
| 49 | + $sessionKey = $request->getInt( 'wpSessionKey' ); |
51 | 50 | $sessionData = $request->getSessionData('wsUploadData'); |
52 | 51 | |
53 | 52 | $desiredDestName = $request->getText( 'wpDestFile' ); |
54 | 53 | if( !$desiredDestName ) |
55 | 54 | $desiredDestName = $request->getText( 'wpUploadFile' ); |
56 | | - return $this->initialize( $desiredDestName, $sessionData[$this->mSessionKey], false ); |
| 55 | + return $this->initialize( $desiredDestName, $sessionKey, $sessionData[$sessionKey] ); |
57 | 56 | } |
58 | 57 | |
59 | 58 | /** |
Index: branches/REL1_16/phase3/includes/api/ApiUpload.php |
— | — | @@ -64,6 +64,7 @@ |
65 | 65 | |
66 | 66 | $this->mUpload = new UploadFromStash(); |
67 | 67 | $this->mUpload->initialize( $this->mParams['filename'], |
| 68 | + $this->mParams['sessionkey'], |
68 | 69 | $_SESSION['wsUploadData'][$this->mParams['sessionkey']] ); |
69 | 70 | } elseif ( isset( $this->mParams['filename'] ) ) { |
70 | 71 | /** |