From 7c023b57714b8140b861bf5a76c5013ec07e8e5d Mon Sep 17 00:00:00 2001 From: aude Date: Thu, 13 Nov 2014 17:14:53 +0100 Subject: [PATCH] Deprecate rarely or unused *LinkAttributes methods in Linker Linker::getInterwikiLinkAttributes and Linker::getInternalLinkAttributesObj are not not used any code in gerrit. Linker::getInternalLinkAttributes is used once, in the Video extension. Change-Id: I76d9b549e0fdccb9c1b4d9c12ba40a67c2733637 --- RELEASE-NOTES-1.25 | 3 +++ includes/Linker.php | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/RELEASE-NOTES-1.25 b/RELEASE-NOTES-1.25 index 7ab8772363..ea5e8b8e7c 100644 --- a/RELEASE-NOTES-1.25 +++ b/RELEASE-NOTES-1.25 @@ -185,6 +185,9 @@ changes to languages because of Bugzilla reports. . * MWFunction::call() and MWFunction::callArray() were removed, having being deprecated in 1.22. +* Deprecated the getInternalLinkAttributes, getInternalLinkAttributesObj, + and getInternalLinkAttributes methods in Linker, and removed + getExternalLinkAttributes method, which was deprecated in MediaWiki 1.18. == Compatibility == diff --git a/includes/Linker.php b/includes/Linker.php index 876aa5f642..0e9ef2b03a 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -39,6 +39,8 @@ class Linker { /** * Get the appropriate HTML attributes to add to the "a" element of an interwiki link. * + * @deprecated since 1.25 + * * @param string $title The title text for the link, URL-encoded (???) but * not HTML-escaped * @param string $unused Unused @@ -49,6 +51,8 @@ class Linker { static function getInterwikiLinkAttributes( $title, $unused = null, $class = 'external' ) { global $wgContLang; + wfDeprecated( __METHOD__, '1.25' ); + # @todo FIXME: We have a whole bunch of handling here that doesn't happen in # getExternalLinkAttributes, why? $title = urldecode( $title ); @@ -61,6 +65,8 @@ class Linker { /** * Get the appropriate HTML attributes to add to the "a" element of an internal link. * + * @deprecated since 1.25 + * * @param string $title The title text for the link, URL-encoded (???) but * not HTML-escaped * @param string $unused Unused @@ -68,6 +74,8 @@ class Linker { * @return string */ static function getInternalLinkAttributes( $title, $unused = null, $class = '' ) { + wfDeprecated( __METHOD__, '1.25' ); + $title = urldecode( $title ); $title = str_replace( '_', ' ', $title ); return self::getLinkAttributesInternal( $title, $class ); @@ -77,6 +85,8 @@ class Linker { * Get the appropriate HTML attributes to add to the "a" element of an internal * link, given the Title object for the page we want to link to. * + * @deprecated since 1.25 + * * @param Title $nt * @param string $unused Unused * @param string $class The contents of the class attribute, default none @@ -85,6 +95,8 @@ class Linker { * @return string */ static function getInternalLinkAttributesObj( $nt, $unused = null, $class = '', $title = false ) { + wfDeprecated( __METHOD__, '1.25' ); + if ( $title === false ) { $title = $nt->getPrefixedText(); } @@ -94,12 +106,16 @@ class Linker { /** * Common code for getLinkAttributesX functions * + * @deprecated since 1.25 + * * @param string $title * @param string $class * * @return string */ private static function getLinkAttributesInternal( $title, $class ) { + wfDeprecated( __METHOD__, '1.25' ); + $title = htmlspecialchars( $title ); $class = htmlspecialchars( $class ); $r = ''; -- 2.20.1