(bug 25325) fix wlexcludeuser for ApiFeedWatchlist
authorMatmaRex <matma.rex@gmail.com>
Sun, 10 Mar 2013 21:08:22 +0000 (22:08 +0100)
committerMatmaRex <matma.rex@gmail.com>
Sun, 10 Mar 2013 21:23:36 +0000 (22:23 +0100)
The effect of setting this option was later overwritten in the code; I
just moved an if a few lines down.

Also some null comparison cleanup.

Change-Id: I2a85673330681c6ff7facc25a7bbfb6972fe8fd5

includes/api/ApiFeedWatchlist.php

index a3b4682..6c793b3 100644 (file)
@@ -61,9 +61,6 @@ class ApiFeedWatchlist extends ApiBase {
                        if( !isset( $wgFeedClasses[$params['feedformat']] ) ) {
                                $this->dieUsage( 'Invalid subscription feed type', 'feed-invalid' );
                        }
-                       if ( !is_null( $params['wlexcludeuser'] ) ) {
-                               $fauxReqArr['wlexcludeuser'] = $params['wlexcludeuser'];
-                       }
 
                        // limit to the number of hours going from now back
                        $endTime = wfTimestamp( TS_MW, time() - intval( $params['hours'] * 60 * 60 ) );
@@ -80,12 +77,15 @@ class ApiFeedWatchlist extends ApiBase {
                                'wllimit' => ( 50 > $wgFeedLimit ) ? $wgFeedLimit : 50
                        );
 
-                       if ( !is_null( $params['wlowner'] ) ) {
+                       if ( $params['wlowner'] !== null ) {
                                $fauxReqArr['wlowner'] = $params['wlowner'];
                        }
-                       if ( !is_null( $params['wltoken'] ) ) {
+                       if ( $params['wltoken'] !== null ) {
                                $fauxReqArr['wltoken'] = $params['wltoken'];
                        }
+                       if ( $params['wlexcludeuser'] !== null ) {
+                               $fauxReqArr['wlexcludeuser'] = $params['wlexcludeuser'];
+                       }
 
                        // Support linking to diffs instead of article
                        if ( $params['linktodiffs'] ) {