From e90d1ecd975e5afb097d94fe91eaecc1ff816346 Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Wed, 14 Apr 2010 04:57:27 +0000 Subject: [PATCH] * EOL ws clean on ApiBase.php * Use an actual value for ApiUpload.php * Commit some code I must've missed for r64852 --- includes/api/ApiBase.php | 2 +- includes/api/ApiUndelete.php | 12 ++---------- includes/api/ApiUpload.php | 2 +- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index b90b0be28f..4aeac9aa9d 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -551,7 +551,7 @@ abstract class ApiBase { case 'preferences': global $wgUser; - if ( isset($titleObj) && !$titleObj->userIsWatching() ) { + if ( isset($titleObj) && !$titleObj->userIsWatching() ) { if ( $titleObj->exists() ) { if ( $wgUser->getOption( 'watchdefault' ) ) { return true; diff --git a/includes/api/ApiUndelete.php b/includes/api/ApiUndelete.php index 421744f793..4cdf34743a 100644 --- a/includes/api/ApiUndelete.php +++ b/includes/api/ApiUndelete.php @@ -81,16 +81,8 @@ class ApiUndelete extends ApiBase { wfRunHooks( 'FileUndeleteComplete', array( $titleObj, array(), $wgUser, $params['reason'] ) ); } - - $watch = $this->getWatchlistValue( $params['watchlist'], $titleObj ); - - if ( $watch !== null ) { - if ( $watch ) { - $wgUser->addWatch( $titleObj ); - } else { - $wgUser->removeWatch( $titleObj ); - } - } + + $this->setWatch( $params['watchlist'], $titleObj ); $info['title'] = $titleObj->getPrefixedText(); $info['revisions'] = intval( $retval[0] ); diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index f81ea24cff..2ff58f8629 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -248,7 +248,7 @@ class ApiUpload extends ApiBase { } $file = $this->mUpload->getLocalFile(); - $watch = $this->getWatchlistValue( $params['watchlist'], $file->getTitle() ); + $watch = $this->getWatchlistValue( $this->mParams['watchlist'], $file->getTitle() ); // Deprecated parameters if ( $this->mParams['watch'] ) { -- 2.20.1