* EOL ws clean on ApiBase.php
authorMark A. Hershberger <mah@users.mediawiki.org>
Wed, 14 Apr 2010 04:57:27 +0000 (04:57 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Wed, 14 Apr 2010 04:57:27 +0000 (04:57 +0000)
* Use an actual value for ApiUpload.php
* Commit some code I must've missed for r64852

includes/api/ApiBase.php
includes/api/ApiUndelete.php
includes/api/ApiUpload.php

index b90b0be..4aeac9a 100644 (file)
@@ -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;
index 421744f..4cdf347 100644 (file)
@@ -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] );
index f81ea24..2ff58f8 100644 (file)
@@ -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'] ) {