[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix links problem on Special:Search

2016-12-09 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/326176 )

Change subject: Fix links problem on Special:Search
..


Fix links problem on Special:Search

Fix bug that most links on Special:Search did not have text rendered
Also restore some changes from commit f736c3709a54be33f808e8d12f85707b90763165
where Linker::link() usage was replaced by LinkRenderer

This reverts commit 791d5319bff0be23c3ea474a84d42ed788355688

Change-Id: Id25d1b1acd0dcafc47511b2db3782e5d441f3731
---
M includes/specials/SpecialRecentchanges.php
M includes/specials/SpecialRevisiondelete.php
M includes/specials/SpecialSearch.php
M includes/specials/SpecialUncategorizedcategories.php
M includes/specials/SpecialUnwatchedpages.php
M includes/specials/SpecialWhatlinkshere.php
6 files changed, 78 insertions(+), 25 deletions(-)

Approvals:
  EBernhardson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialRecentchanges.php 
b/includes/specials/SpecialRecentchanges.php
index 2a93159..8530eb1 100644
--- a/includes/specials/SpecialRecentchanges.php
+++ b/includes/specials/SpecialRecentchanges.php
@@ -665,12 +665,11 @@
}
unset( $value );
 
-   $text = htmlspecialchars( $title );
if ( $active ) {
-   $text = '' . $text . '';
+   $title = new HtmlArmor( '' . htmlspecialchars( 
$title ) . '' );
}
 
-   return Linker::linkKnown( $this->getPageTitle(), $text, [], 
$params );
+   return $this->getLinkRenderer()->makeKnownLink( 
$this->getPageTitle(), $title, [], $params );
}
 
/**
diff --git a/includes/specials/SpecialRevisiondelete.php 
b/includes/specials/SpecialRevisiondelete.php
index 8780c56..4b0fa00 100644
--- a/includes/specials/SpecialRevisiondelete.php
+++ b/includes/specials/SpecialRevisiondelete.php
@@ -466,9 +466,9 @@
Xml::closeElement( 'form' ) . "\n";
// Show link to edit the dropdown reasons
if ( $this->getUser()->isAllowed( 'editinterface' ) ) {
-   $link = Linker::linkKnown(
+   $link = $this->getLinkRenderer()->makeKnownLink(
$this->msg( 'revdelete-reason-dropdown' 
)->inContentLanguage()->getTitle(),
-   $this->msg( 'revdelete-edit-reasonlist' 
)->escaped(),
+   $this->msg( 'revdelete-edit-reasonlist' 
)->text(),
[],
[ 'action' => 'edit' ]
);
diff --git a/includes/specials/SpecialSearch.php 
b/includes/specials/SpecialSearch.php
index 9f83832..727179a 100644
--- a/includes/specials/SpecialSearch.php
+++ b/includes/specials/SpecialSearch.php
@@ -499,9 +499,16 @@
}
$stParams = array_merge( $params, $this->powerSearchOptions() );
 
-   $suggest = Linker::linkKnown(
+   $linkRenderer = $this->getLinkRenderer();
+
+   $snippet = $textMatches->getSuggestionSnippet() ?: null;
+   if ( $snippet !== null ) {
+   $snippet = new HtmlArmor( $snippet );
+   }
+
+   $suggest = $linkRenderer->makeKnownLink(
$this->getPageTitle(),
-   $textMatches->getSuggestionSnippet() ?: null,
+   $snippet,
[ 'id' => 'mw-search-DYM-suggestion' ],
$stParams
);
@@ -535,18 +542,25 @@
}
$stParams = array_merge( $params, $this->powerSearchOptions() );
 
-   $rewritten = Linker::linkKnown(
+   $linkRenderer = $this->getLinkRenderer();
+
+   $snippet = $textMatches->getQueryAfterRewriteSnippet() ?: null;
+   if ( $snippet !== null ) {
+   $snippet = new HtmlArmor( $snippet );
+   }
+
+   $rewritten = $linkRenderer->makeKnownLink(
$this->getPageTitle(),
-   $textMatches->getQueryAfterRewriteSnippet() ?: null,
+   $snippet,
[ 'id' => 'mw-search-DYM-rewritten' ],
$stParams
);
 
$stParams['search'] = $term;
$stParams['runsuggestion'] = 0;
-   $original = Linker::linkKnown(
+   $original = $linkRenderer->makeKnownLink(
$this->getPageTitle(),
-   htmlspecialchars( $term ),
+   $term,
[ 'id' => 'mw-search-DYM-original' ],
$stParams
);
@@ -766,7 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix links problem on Special:Search

2016-12-09 Thread Phantom42 (Code Review)
Phantom42 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/326176 )

Change subject: Fix links problem on Special:Search
..

Fix links problem on Special:Search

Fix bug that most links on Special:Search did not have text rendered
Also restore some changes from commit f736c3709a54be33f808e8d12f85707b90763165
where Linker::link() usage was replaced by LinkRenderer

This reverts commit 791d5319bff0be23c3ea474a84d42ed788355688

Change-Id: Id25d1b1acd0dcafc47511b2db3782e5d441f3731
---
M includes/specials/SpecialRecentchanges.php
M includes/specials/SpecialRevisiondelete.php
M includes/specials/SpecialSearch.php
M includes/specials/SpecialUncategorizedcategories.php
M includes/specials/SpecialUnwatchedpages.php
M includes/specials/SpecialWhatlinkshere.php
6 files changed, 78 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/76/326176/1

diff --git a/includes/specials/SpecialRecentchanges.php 
b/includes/specials/SpecialRecentchanges.php
index 2a93159..8530eb1 100644
--- a/includes/specials/SpecialRecentchanges.php
+++ b/includes/specials/SpecialRecentchanges.php
@@ -665,12 +665,11 @@
}
unset( $value );
 
-   $text = htmlspecialchars( $title );
if ( $active ) {
-   $text = '' . $text . '';
+   $title = new HtmlArmor( '' . htmlspecialchars( 
$title ) . '' );
}
 
-   return Linker::linkKnown( $this->getPageTitle(), $text, [], 
$params );
+   return $this->getLinkRenderer()->makeKnownLink( 
$this->getPageTitle(), $title, [], $params );
}
 
/**
diff --git a/includes/specials/SpecialRevisiondelete.php 
b/includes/specials/SpecialRevisiondelete.php
index 8780c56..4b0fa00 100644
--- a/includes/specials/SpecialRevisiondelete.php
+++ b/includes/specials/SpecialRevisiondelete.php
@@ -466,9 +466,9 @@
Xml::closeElement( 'form' ) . "\n";
// Show link to edit the dropdown reasons
if ( $this->getUser()->isAllowed( 'editinterface' ) ) {
-   $link = Linker::linkKnown(
+   $link = $this->getLinkRenderer()->makeKnownLink(
$this->msg( 'revdelete-reason-dropdown' 
)->inContentLanguage()->getTitle(),
-   $this->msg( 'revdelete-edit-reasonlist' 
)->escaped(),
+   $this->msg( 'revdelete-edit-reasonlist' 
)->text(),
[],
[ 'action' => 'edit' ]
);
diff --git a/includes/specials/SpecialSearch.php 
b/includes/specials/SpecialSearch.php
index 9f83832..727179a 100644
--- a/includes/specials/SpecialSearch.php
+++ b/includes/specials/SpecialSearch.php
@@ -499,9 +499,16 @@
}
$stParams = array_merge( $params, $this->powerSearchOptions() );
 
-   $suggest = Linker::linkKnown(
+   $linkRenderer = $this->getLinkRenderer();
+
+   $snippet = $textMatches->getSuggestionSnippet() ?: null;
+   if ( $snippet !== null ) {
+   $snippet = new HtmlArmor( $snippet );
+   }
+
+   $suggest = $linkRenderer->makeKnownLink(
$this->getPageTitle(),
-   $textMatches->getSuggestionSnippet() ?: null,
+   $snippet,
[ 'id' => 'mw-search-DYM-suggestion' ],
$stParams
);
@@ -535,18 +542,25 @@
}
$stParams = array_merge( $params, $this->powerSearchOptions() );
 
-   $rewritten = Linker::linkKnown(
+   $linkRenderer = $this->getLinkRenderer();
+
+   $snippet = $textMatches->getQueryAfterRewriteSnippet() ?: null;
+   if ( $snippet !== null ) {
+   $snippet = new HtmlArmor( $snippet );
+   }
+
+   $rewritten = $linkRenderer->makeKnownLink(
$this->getPageTitle(),
-   $textMatches->getQueryAfterRewriteSnippet() ?: null,
+   $snippet,
[ 'id' => 'mw-search-DYM-rewritten' ],
$stParams
);
 
$stParams['search'] = $term;
$stParams['runsuggestion'] = 0;
-   $original = Linker::linkKnown(
+   $original = $linkRenderer->makeKnownLink(
$this->getPageTitle(),
-   htmlspecialchars( $term ),
+   $term,
[ 'id' => 'mw-search-DYM-original' ],
$stParams
);
@@ -766,7