From: Sam Reed Date: Fri, 29 Jan 2010 14:38:57 +0000 (+0000) Subject: Reduce code duplication by having tables added in all code paths, by adding before if X-Git-Tag: 1.31.0-rc.0~38057 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=5d553e35a31546e1e0b40c9338ef5bfe9435d7e1;p=lhc%2Fweb%2Fwiklou.git Reduce code duplication by having tables added in all code paths, by adding before if --- diff --git a/includes/api/ApiQueryWatchlist.php b/includes/api/ApiQueryWatchlist.php index 4f81734971..aea14ed209 100644 --- a/includes/api/ApiQueryWatchlist.php +++ b/includes/api/ApiQueryWatchlist.php @@ -91,14 +91,17 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { $this->dieUsage( 'patrol property is not available', 'patrol' ); } } + + $this->addFields( array ( + 'rc_namespace', + 'rc_title', + 'rc_timestamp' + ) ); if ( is_null( $resultPageSet ) ) { $this->addFields( array ( 'rc_cur_id', - 'rc_this_oldid', - 'rc_namespace', - 'rc_title', - 'rc_timestamp' + 'rc_this_oldid' ) ); $this->addFieldsIf( 'rc_new', $this->fld_flags ); @@ -110,21 +113,10 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { $this->addFieldsIf( 'rc_patrolled', $this->fld_patrol ); $this->addFieldsIf( 'rc_old_len', $this->fld_sizes ); $this->addFieldsIf( 'rc_new_len', $this->fld_sizes ); - } - elseif ( $params['allrev'] ) { - $this->addFields( array ( - 'rc_this_oldid', - 'rc_namespace', - 'rc_title', - 'rc_timestamp' - ) ); + } elseif ( $params['allrev'] ) { + $this->addFields( 'rc_this_oldid' ); } else { - $this->addFields( array ( - 'rc_cur_id', - 'rc_namespace', - 'rc_title', - 'rc_timestamp' - ) ); + $this->addFields( 'rc_cur_id' ); } $this->addTables( array (