r52035 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52034‎ | r52035 | r52036 >
Date:09:48, 17 June 2009
Author:dale
Status:deferred
Tags:
Comment:
added token to return url for firefogg
style image update
Modified paths:
  • /branches/new-upload/phase3/includes/UploadFromChunks.php (modified) (history)

Diff [purge]

Index: branches/new-upload/phase3/includes/UploadFromChunks.php
@@ -142,13 +142,16 @@
143143 }
144144 //lets us return an api result (as flow for chunk uploads is kind of different than others.
145145 function performUpload($summary='', $comment='', $watch='', $user){
146 - global $wgServer, $wgScriptPath;
 146+ global $wgServer, $wgScriptPath, $wgUser;
147147 if( $this->chunk_mode == UploadFromChunks::INIT ){
148148 //firefogg expects a specific result per:
149149 //http://www.firefogg.org/dev/chunk_post.html
150150 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 ) ) );
153156 exit(0);
154157 }else if( $this->chunk_mode == UploadFromChunks::CHUNK ){
155158 $status = $this->doChunkAppend();

Status & tagging log