Merge "Use Database::addQuotes in Special:WantedPages/UnwatchedPages"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 2 Nov 2016 23:37:18 +0000 (23:37 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 2 Nov 2016 23:37:18 +0000 (23:37 +0000)
1  2 
includes/specials/SpecialUnwatchedpages.php

@@@ -43,27 -43,8 +43,28 @@@ class UnwatchedpagesPage extends QueryP
                return false;
        }
  
 +      /**
 +       * Pre-cache page existence to speed up link generation
 +       *
 +       * @param IDatabase $db
 +       * @param ResultWrapper $res
 +       */
 +      public function preprocessResults( $db, $res ) {
 +              if ( !$res->numRows() ) {
 +                      return;
 +              }
 +
 +              $batch = new LinkBatch();
 +              foreach ( $res as $row ) {
 +                      $batch->add( $row->namespace, $row->title );
 +              }
 +              $batch->execute();
 +
 +              $res->seek( 0 );
 +      }
 +
        public function getQueryInfo() {
+               $dbr = wfGetDB( DB_REPLICA );
                return [
                        'tables' => [ 'page', 'watchlist' ],
                        'fields' => [