Merge "Add test for bracketed external links with invalid template-generated target"
authorIAlex <ialex.wiki@gmail.com>
Thu, 8 Nov 2012 19:15:19 +0000 (19:15 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 8 Nov 2012 19:15:19 +0000 (19:15 +0000)
RELEASE-NOTES-1.21
includes/RecentChange.php
includes/api/ApiQueryRevisions.php
includes/specials/SpecialRecentchanges.php
includes/specials/SpecialRecentchangeslinked.php
includes/specials/SpecialWatchlist.php

index 4be260e..b9b026c 100644 (file)
@@ -60,6 +60,7 @@ production.
 * (bug 26995) Update filename field on Upload page after having sanitized it.
 * (bug 41793) Contribution links to users with 0 edits on Special:ListUsers didn't
   show up red.
+* (bug 41899) A PHP notice no longer occurs when using the "rvcontinue" API parameter.
 
 === API changes in 1.21 ===
 * prop=revisions can now report the contentmodel and contentformat, see docs/contenthandler.txt
index 3cf6c72..2bdcab4 100644 (file)
@@ -125,7 +125,7 @@ class RecentChange {
         */
        public static function newFromConds( $conds, $fname = __METHOD__ ) {
                $dbr = wfGetDB( DB_SLAVE );
-               $row = $dbr->selectRow( 'recentchanges', '*', $conds, $fname );
+               $row = $dbr->selectRow( 'recentchanges', self::selectFields(), $conds, $fname );
                if ( $row !== false ) {
                        return self::newFromRow( $row );
                } else {
@@ -133,6 +133,40 @@ class RecentChange {
                }
        }
 
+       /**
+        * Return the list of recentchanges fields that should be selected to create
+        * a new recentchanges object.
+        * @return array
+        */
+       public static function selectFields() {
+               return array(
+                       'rc_id',
+                       'rc_timestamp',
+                       'rc_cur_time',
+                       'rc_user',
+                       'rc_user_text',
+                       'rc_namespace',
+                       'rc_title',
+                       'rc_comment',
+                       'rc_minor',
+                       'rc_bot',
+                       'rc_new',
+                       'rc_cur_id',
+                       'rc_this_oldid',
+                       'rc_last_oldid',
+                       'rc_type',
+                       'rc_patrolled',
+                       'rc_ip',
+                       'rc_old_len',
+                       'rc_new_len',
+                       'rc_deleted',
+                       'rc_logid',
+                       'rc_log_type',
+                       'rc_log_action',
+                       'rc_params',
+               );
+       }
+
        # Accessors
 
        /**
index 5c3b33b..ad40a64 100644 (file)
@@ -261,7 +261,7 @@ class ApiQueryRevisions extends ApiQueryBase {
                        // rvstart and rvstartid when that is supplied.
                        if ( !is_null( $params['continue'] ) ) {
                                $params['startid'] = $params['continue'];
-                               unset( $params['start'] );
+                               $params['start'] = null;
                        }
 
                        // This code makes an assumption that sorting by rev_id and rev_timestamp produces
index 2bd8b0a..f542640 100644 (file)
@@ -382,7 +382,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                $invert = $opts['invert'];
                $associated = $opts['associated'];
 
-               $fields = array( $dbr->tableName( 'recentchanges' ) . '.*' ); // all rc columns
+               $fields = RecentChange::selectFields();
                // JOIN on watchlist for users
                if ( $uid ) {
                        $tables[] = 'watchlist';
index 40ebc2f..4db8958 100644 (file)
@@ -93,7 +93,7 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
                $dbkey = $title->getDBkey();
 
                $tables = array( 'recentchanges' );
-               $select = array( $dbr->tableName( 'recentchanges' ) . '.*' );
+               $select = RecentChange::selectFields();
                $join_conds = array();
                $query_options = array();
 
index 5dfc113..688e0a5 100644 (file)
@@ -272,7 +272,7 @@ class SpecialWatchlist extends SpecialPage {
                $form .= '<hr />';
 
                $tables = array( 'recentchanges', 'watchlist' );
-               $fields = array( $dbr->tableName( 'recentchanges' ) . '.*' );
+               $fields = RecentChange::selectFields();
                $join_conds = array(
                        'watchlist' => array(
                                'INNER JOIN',