Index: trunk/phase3/includes/api/ApiQueryWatchlist.php |
— | — | @@ -52,7 +52,7 @@ |
53 | 53 | $fld_timestamp = false, $fld_user = false, $fld_comment = false, $fld_sizes = false; |
54 | 54 | |
55 | 55 | private function run( $resultPageSet = null ) { |
56 | | - global $wgUser, $wgDBtype; |
| 56 | + global $wgUser; |
57 | 57 | |
58 | 58 | $this->selectNamedDB( 'watchlist', DB_SLAVE, 'watchlist' ); |
59 | 59 | |
— | — | @@ -150,9 +150,7 @@ |
151 | 151 | $this->dieUsage( "Incorrect parameter - mutually exclusive values may not be supplied", 'show' ); |
152 | 152 | } |
153 | 153 | |
154 | | - // Check permissions. FIXME: should this check $user instead of |
155 | | - // $wgUser? |
156 | | - global $wgUser; |
| 154 | + // Check permissions. FIXME: should this check $user instead of $wgUser? |
157 | 155 | if ( ( isset( $show['patrolled'] ) || isset( $show['!patrolled'] ) ) && !$wgUser->useRCPatrol() && !$wgUser->useNPPatrol() ) |
158 | 156 | $this->dieUsage( "You need the patrol right to request the patrolled flag", 'permissiondenied' ); |
159 | 157 | |
— | — | @@ -174,7 +172,7 @@ |
175 | 173 | if ( !is_null( $params['excludeuser'] ) ) |
176 | 174 | $this->addWhere( 'rc_user_text != ' . $this->getDB()->addQuotes( $params['excludeuser'] ) ); |
177 | 175 | |
178 | | - |
| 176 | + global $wgDBtype; |
179 | 177 | // This is an index optimization for mysql, as done in the Special:Watchlist page |
180 | 178 | $this->addWhereIf( "rc_timestamp > ''", !isset ( $params['start'] ) && !isset ( $params['end'] ) && $wgDBtype == 'mysql' ); |
181 | 179 | |