From 01acafb746adbf4498e696b7f44c996bb350c0c5 Mon Sep 17 00:00:00 2001 From: Fomafix Date: Tue, 21 May 2019 10:18:25 +0200 Subject: [PATCH] Skin: Hard deprecate escapeSearchLink() Use getSearchLink() instead of escapeSearchLink() in SkinTemplate for 'searchaction'. The skins do the HTML escaping of 'searchaction' themself. Depends-On: I6493cec99e22f2c56a081f1fc4d96ebc584915de Depends-On: I268b412d84ba73d6fdae633a343c45865cb8b07b Change-Id: I32f51a048b7a95e3697eaf18f2bd2f9a3b96065f --- RELEASE-NOTES-1.34 | 2 ++ includes/skins/Skin.php | 2 ++ includes/skins/SkinTemplate.php | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES-1.34 b/RELEASE-NOTES-1.34 index bba7df1455..2b5731184e 100644 --- a/RELEASE-NOTES-1.34 +++ b/RELEASE-NOTES-1.34 @@ -320,6 +320,8 @@ because of Phabricator reports. * The use of the $terms param in the ShowSearchHit and ShowSearchHitTitle hooks is highly discouraged as it's only populated by SearchDatabase search engines. +* Skin::escapeSearchLink() is deprecated. Use Skin::getSearchLink() or the skin + template option 'searchaction' instead. === Other changes in 1.34 === * … diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index 05b6297986..918c761bca 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -813,9 +813,11 @@ abstract class Skin extends ContextSource { } /** + * @deprecated since 1.34, use getSearchLink() instead. * @return string */ function escapeSearchLink() { + wfDeprecated( __METHOD__, '1.34' ); return htmlspecialchars( $this->getSearchLink() ); } diff --git a/includes/skins/SkinTemplate.php b/includes/skins/SkinTemplate.php index 8b46ee9958..5d6197e7ac 100644 --- a/includes/skins/SkinTemplate.php +++ b/includes/skins/SkinTemplate.php @@ -317,7 +317,7 @@ class SkinTemplate extends Skin { $tpl->set( 'handheld', $request->getBool( 'handheld' ) ); $tpl->set( 'loggedin', $this->loggedin ); $tpl->set( 'notspecialpage', !$title->isSpecialPage() ); - $tpl->set( 'searchaction', $this->escapeSearchLink() ); + $tpl->set( 'searchaction', $this->getSearchLink() ); $tpl->set( 'searchtitle', SpecialPage::getTitleFor( 'Search' )->getPrefixedDBkey() ); $tpl->set( 'search', trim( $request->getVal( 'search' ) ) ); $tpl->set( 'stylepath', $wgStylePath ); -- 2.20.1