From: MatmaRex Date: Sun, 10 Mar 2013 21:08:22 +0000 (+0100) Subject: (bug 25325) fix wlexcludeuser for ApiFeedWatchlist X-Git-Tag: 1.31.0-rc.0~20401^2 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=8a539b8e9ac02363819794d4b609122d4c5f6110;p=lhc%2Fweb%2Fwiklou.git (bug 25325) fix wlexcludeuser for ApiFeedWatchlist 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 --- diff --git a/includes/api/ApiFeedWatchlist.php b/includes/api/ApiFeedWatchlist.php index a3b468213e..6c793b36c8 100644 --- a/includes/api/ApiFeedWatchlist.php +++ b/includes/api/ApiFeedWatchlist.php @@ -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'] ) {