r55835 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55834‎ | r55835 | r55836 >
Date:20:12, 4 September 2009
Author:ialex
Status:ok
Tags:
Comment:
use wfScript() so that it uses $wgScriptExtension to get the path to api.php(5)
Modified paths:
  • /trunk/phase3/includes/upload/UploadFromChunks.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/upload/UploadFromChunks.php
@@ -155,7 +155,7 @@
156156
157157 // Lets us return an api result (as flow for chunk uploads is kind of different than others.
158158 function performUpload( $summary = '', $comment = '', $watch = '', $user ){
159 - global $wgServer, $wgScriptPath, $wgUser;
 159+ global $wgUser;
160160
161161 if( $this->chunk_mode == UploadFromChunks::INIT ){
162162 // firefogg expects a specific result per:
@@ -168,7 +168,7 @@
169169 $token = urlencode( $wgUser->editToken() );
170170 ob_clean();
171171 echo ApiFormatJson::getJsonEncode( array(
172 - 'uploadUrl' => "{$wgServer}{$wgScriptPath}/api.php?action=upload&".
 172+ 'uploadUrl' => wfExpandUrl( wfScript( 'api' ) ) . "?action=upload&".
173173 "token={$token}&format=json&enablechunks=true&chunksessionkey=".
174174 $this->setupChunkSession( $summary, $comment, $watch ) ) );
175175 exit( 0 );

Status & tagging log