Added spaces before and removed spaces after 'array'
[lhc/web/wiklou.git] / includes / api / ApiQueryWatchlist.php
index dd50624..491d20f 100644 (file)
@@ -135,7 +135,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase {
 
                if ( !$params['allrev'] ) {
                        $this->addTables( 'page' );
-                       $this->addJoinConds( array( 'page' => array( 'LEFT JOIN','rc_cur_id=page_id' ) ) );
+                       $this->addJoinConds( array( 'page' => array( 'LEFT JOIN', 'rc_cur_id=page_id' ) ) );
                        $this->addWhere( 'rc_this_oldid=page_latest OR rc_type=' . RC_LOG );
                }
 
@@ -240,14 +240,16 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase {
 
                if ( $this->fld_user || $this->fld_userid ) {
 
-                       if ( $this->fld_user ) {
-                               $vals['user'] = $row->rc_user_text;
-                       }
-
                        if ( $this->fld_userid ) {
+                               $vals['userid'] = $row->rc_user;
+                               // for backwards compatibility
                                $vals['user'] = $row->rc_user;
                        }
 
+                       if ( $this->fld_user ) {
+                               $vals['user'] = $row->rc_user_text;
+                       }
+
                        if ( !$row->rc_user ) {
                                $vals['anon'] = '';
                        }
@@ -319,7 +321,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase {
                        'end' => array(
                                ApiBase::PARAM_TYPE => 'timestamp'
                        ),
-                       'namespace' => array (
+                       'namespace' => array(
                                ApiBase::PARAM_ISMULTI => true,
                                ApiBase::PARAM_TYPE => 'namespace'
                        ),
@@ -511,7 +513,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase {
                        'api.php?action=query&list=watchlist&wlallrev=&wlprop=ids|title|timestamp|user|comment',
                        'api.php?action=query&generator=watchlist&prop=info',
                        'api.php?action=query&generator=watchlist&gwlallrev=&prop=revisions&rvprop=timestamp|user',
-                       'api.php?action=query&list=watchlist&wlowner=Bob_Smith&wltoken=d8d562e9725ea1512894cdab28e5ceebc7f20237'
+                       'api.php?action=query&list=watchlist&wlowner=Bob_Smith&wltoken=123ABC'
                );
        }