Index: branches/new-upload/phase3/includes/UploadFromChunks.php |
— | — | @@ -142,13 +142,16 @@ |
143 | 143 | } |
144 | 144 | //lets us return an api result (as flow for chunk uploads is kind of different than others. |
145 | 145 | function performUpload($summary='', $comment='', $watch='', $user){ |
146 | | - global $wgServer, $wgScriptPath; |
| 146 | + global $wgServer, $wgScriptPath, $wgUser; |
147 | 147 | if( $this->chunk_mode == UploadFromChunks::INIT ){ |
148 | 148 | //firefogg expects a specific result per: |
149 | 149 | //http://www.firefogg.org/dev/chunk_post.html |
150 | 150 | ob_clean(); |
151 | | - echo ApiFormatJson::getJsonEncode( array( "uploadUrl" => "{$wgServer}{$wgScriptPath}/api.php?action=upload&format=json&enablechunks=true&chunksessionkey=". |
152 | | - $this->setupChunkSession($summary, $comment, $watch ) ) ); |
| 151 | + echo ApiFormatJson::getJsonEncode( array( |
| 152 | + "uploadUrl" => "{$wgServer}{$wgScriptPath}/api.php?action=upload&". |
| 153 | + "token=" . htmlspecialchars( $wgUser->editToken() ) . "&". |
| 154 | + "format=json&enablechunks=true&chunksessionkey=". |
| 155 | + $this->setupChunkSession($summary, $comment, $watch ) ) ); |
153 | 156 | exit(0); |
154 | 157 | }else if( $this->chunk_mode == UploadFromChunks::CHUNK ){ |
155 | 158 | $status = $this->doChunkAppend(); |