r59657 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59656‎ | r59657 | r59658 >
Date:12:28, 2 December 2009
Author:catrope
Status:ok
Tags:
Comment:
API: Minor cleanup for r59258, general whitespace cleanup
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryInfo.php (modified) (history)
  • /trunk/phase3/includes/api/ApiUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryInfo.php
@@ -331,6 +331,7 @@
332332 // Get normal protections for existing titles
333333 if(count($this->titles))
334334 {
 335+ $this->resetQueryParams();
335336 $this->addTables(array('page_restrictions', 'page'));
336337 $this->addWhere('page_id=pr_page');
337338 $this->addFields(array('pr_page', 'pr_type', 'pr_level',
@@ -505,8 +506,8 @@
506507 }
507508
508509 /**
509 - * Get information about watched status and put it in $watched
510 - */
 510+ * Get information about watched status and put it in $watched
 511+ */
511512 private function getWatchedInfo()
512513 {
513514 global $wgUser;
@@ -519,12 +520,15 @@
520521
521522 $lb = new LinkBatch($this->titles);
522523
 524+ $this->resetQueryParams();
523525 $this->addTables(array('page', 'watchlist'));
524526 $this->addFields(array('page_title', 'page_namespace'));
525 - $this->addWhere($lb->constructSet('page', $db));
526 - $this->addWhere('wl_title=page_title');
527 - $this->addWhere('wl_namespace=page_namespace');
528 - $this->addWhereFld('wl_user', $wgUser->getID());
 527+ $this->addWhere(array(
 528+ $lb->constructSet('page', $db),
 529+ 'wl_namespace=page_namespace',
 530+ 'wl_title=page_title',
 531+ 'wl_user' => $wgUser->getID()
 532+ ));
529533
530534 $res = $this->select(__METHOD__);
531535
Index: trunk/phase3/includes/api/ApiUpload.php
@@ -68,7 +68,7 @@
6969 */
7070 // Check the session key
7171 if( !isset( $_SESSION['wsUploadData'][$this->mParams['sessionkey']] ) )
72 - return $this->dieUsageMsg( array( 'invalid-session-key' ) );
 72+ return $this->dieUsageMsg( array( 'invalid-session-key' ) );
7373
7474 $this->mUpload = new UploadFromStash();
7575 $this->mUpload->initialize( $this->mParams['filename'],
@@ -246,7 +246,7 @@
247247
248248 // Append imageinfo to the result
249249 $imParam = ApiQueryImageInfo::getPropertyNames();
250 - $result['imageinfo'] = ApiQueryImageInfo::getInfo( $file,
 250+ $result['imageinfo'] = ApiQueryImageInfo::getInfo( $file,
251251 array_flip( $imParam ), $this->getResult() );
252252
253253 return $result;
@@ -322,5 +322,3 @@
323323 return __CLASS__ . ': $Id: ApiUpload.php 51812 2009-06-12 23:45:20Z dale $';
324324 }
325325 }
326 -
327 -

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r59258bug 19523 prop=info&inprop=watchedreedy17:57, 19 November 2009

Status & tagging log