r65010 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65009‎ | r65010 | r65011 >
Date:04:57, 14 April 2010
Author:mah
Status:ok
Tags:
Comment:
* EOL ws clean on ApiBase.php
* Use an actual value for ApiUpload.php
* Commit some code I must've missed for r64852
Modified paths:
  • /trunk/phase3/includes/api/ApiBase.php (modified) (history)
  • /trunk/phase3/includes/api/ApiUndelete.php (modified) (history)
  • /trunk/phase3/includes/api/ApiUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiUndelete.php
@@ -81,17 +81,9 @@
8282 wfRunHooks( 'FileUndeleteComplete',
8383 array( $titleObj, array(), $wgUser, $params['reason'] ) );
8484 }
85 -
86 - $watch = $this->getWatchlistValue( $params['watchlist'], $titleObj );
87 -
88 - if ( $watch !== null ) {
89 - if ( $watch ) {
90 - $wgUser->addWatch( $titleObj );
91 - } else {
92 - $wgUser->removeWatch( $titleObj );
93 - }
94 - }
9585
 86+ $this->setWatch( $params['watchlist'], $titleObj );
 87+
9688 $info['title'] = $titleObj->getPrefixedText();
9789 $info['revisions'] = intval( $retval[0] );
9890 $info['fileversions'] = intval( $retval[1] );
Index: trunk/phase3/includes/api/ApiBase.php
@@ -551,7 +551,7 @@
552552
553553 case 'preferences':
554554 global $wgUser;
555 - if ( isset($titleObj) && !$titleObj->userIsWatching() ) {
 555+ if ( isset($titleObj) && !$titleObj->userIsWatching() ) {
556556 if ( $titleObj->exists() ) {
557557 if ( $wgUser->getOption( 'watchdefault' ) ) {
558558 return true;
Index: trunk/phase3/includes/api/ApiUpload.php
@@ -248,7 +248,7 @@
249249 }
250250
251251 $file = $this->mUpload->getLocalFile();
252 - $watch = $this->getWatchlistValue( $params['watchlist'], $file->getTitle() );
 252+ $watch = $this->getWatchlistValue( $this->mParams['watchlist'], $file->getTitle() );
253253
254254 // Deprecated parameters
255255 if ( $this->mParams['watch'] ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r64852* Clean up some duplicated code in r64291...mah06:11, 10 April 2010

Status & tagging log