Merge "Watchlist: Fix form and preference overriding"
[lhc/web/wiklou.git] / includes / specials / SpecialLinkSearch.php
index 307d6c3..a1f5efa 100644 (file)
@@ -22,6 +22,8 @@
  * @author Brion Vibber
  */
 
+use Wikimedia\Rdbms\ResultWrapper;
+
 /**
  * Special:LinkSearch to search the external-links table.
  * @ingroup SpecialPage
@@ -225,16 +227,7 @@ class LinkSearchPage extends QueryPage {
         * @param ResultWrapper $res
         */
        function preprocessResults( $db, $res ) {
-               if ( $res->numRows() > 0 ) {
-                       $linkBatch = new LinkBatch();
-
-                       foreach ( $res as $row ) {
-                               $linkBatch->add( $row->namespace, $row->title );
-                       }
-
-                       $res->seek( 0 );
-                       $linkBatch->execute();
-               }
+               $this->executeLBFromResultWrapper( $res );
        }
 
        /**