r53327 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53326‎ | r53327 | r53328 >
Date:20:27, 15 July 2009
Author:dale
Status:resolved (Comments)
Tags:
Comment:
fixed httpstatus boolean & updated error to use dieUsageMsg
Modified paths:
  • /trunk/phase3/includes/api/ApiUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiUpload.php
@@ -89,9 +89,7 @@
9090 } else if( $this->mParams['httpstatus'] && $this->mParams['sessionkey'] ){
9191 // return the status of the given upload session_key:
9292 if( !isset( $_SESSION['wsDownload'][ $this->mParams['sessionkey'] ] ) ){
93 - return $this->getResult()->addValue( null, $this->getModuleName(),
94 - array( 'error' => 'invalid-session-key'
95 - ));
 93+ return $this->dieUsageMsg( array( 'error' => 'invalid-session-key' ) );
9694 }
9795 $sd = & $_SESSION['wsDownload'][$this->mParams['sessionkey']];
9896 // keep passing down the upload sessionkey
@@ -302,7 +300,7 @@
303301 'ignorewarnings' => false,
304302 'done' => false,
305303 'sessionkey' => null,
306 - 'httpstatus' => null,
 304+ 'httpstatus' => false,
307305 'chunksessionkey' => null,
308306 'internalhttpsession' => null,
309307 );

Comments

#Comment by Catrope (talk | contribs)   21:09, 15 July 2009

That's not how dieUsageMsg() works. You either need dieUsage( "Error message here", 'invalid-session-key' ); or do dieUsageMsg( array( 'invalid-session-key' ) ); and add an entry for it to ApiBase::$messageMap

#Comment by Mdale (talk | contribs)   23:12, 15 July 2009

opps ... oky fixed in r53342

Status & tagging log