From: Kunal Mehta Date: Sun, 10 Jun 2018 18:30:15 +0000 (-0700) Subject: linker: Hard-deprecate LinkBegin and LinkEnd hooks X-Git-Tag: 1.34.0-rc.0~5099^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=d78d6e23cf90a973d41401daa63805d7f9bb35a9;p=lhc%2Fweb%2Fwiklou.git linker: Hard-deprecate LinkBegin and LinkEnd hooks Change-Id: Ia1d766d019a2711c96e7c41913055774eff9f777 --- diff --git a/includes/linker/LinkRenderer.php b/includes/linker/LinkRenderer.php index 87d7e0a4a7..d096b001ea 100644 --- a/includes/linker/LinkRenderer.php +++ b/includes/linker/LinkRenderer.php @@ -204,7 +204,7 @@ class LinkRenderer { $realHtml = $html = null; } if ( !Hooks::run( 'LinkBegin', - [ $dummy, $title, &$html, &$extraAttribs, &$query, &$options, &$ret ] ) + [ $dummy, $title, &$html, &$extraAttribs, &$query, &$options, &$ret ], '1.28' ) ) { return $ret; } @@ -373,7 +373,7 @@ class LinkRenderer { $title = Title::newFromLinkTarget( $target ); $options = $this->getLegacyOptions( $isKnown ); if ( !Hooks::run( 'LinkEnd', - [ $dummy, $title, $options, &$html, &$attribs, &$ret ] ) + [ $dummy, $title, $options, &$html, &$attribs, &$ret ], '1.28' ) ) { return $ret; } diff --git a/tests/phpunit/includes/LinkerTest.php b/tests/phpunit/includes/LinkerTest.php index f9e2cc1733..f90ece921b 100644 --- a/tests/phpunit/includes/LinkerTest.php +++ b/tests/phpunit/includes/LinkerTest.php @@ -370,6 +370,7 @@ class LinkerTest extends MediaWikiLangTestCase { * @dataProvider provideLinkBeginHook */ public function testLinkBeginHook( $callback, $expected ) { + $this->hideDeprecated( 'LinkBegin hook (used in hook-LinkBegin-closure)' ); $this->setMwGlobals( [ 'wgArticlePath' => '/wiki/$1', 'wgServer' => '//example.org', @@ -417,6 +418,7 @@ class LinkerTest extends MediaWikiLangTestCase { * @dataProvider provideLinkEndHook */ public function testLinkEndHook( $callback, $expected ) { + $this->hideDeprecated( 'LinkEnd hook (used in hook-LinkEnd-closure)' ); $this->setMwGlobals( [ 'wgArticlePath' => '/wiki/$1', ] );