From ea01e7cfbb9976703fcc14694310ceea749ca0bc Mon Sep 17 00:00:00 2001 From: Thiemo Kreuz Date: Thu, 23 Jan 2020 09:29:54 +0100 Subject: [PATCH] parser: Remove unused ParserAfterUnstrip hook Introduced in 2015 via If83b062. Unfortunately the patch fails to mention why the hook was introduced. A review comment asking for the missing information was ignored. The hook was introduced exclusively for the Cite extension, see I0e136f9. The Cite change got reverted a few days later via I1a71854. As far as I can tell the hook (oddly specific and underspecified anyway) was never used again, neither for Cite nor for anything else. Now unused: https://codesearch.wmflabs.org/search/?q=ParserAfterUnstrip I suggest to just remove it with no deprecation phase. My team is currently working on Cite, essentially turning it upside down. I'm not aware of a need for this hook. Change-Id: If68a88d7afff60385ff1e33fd13716b20d01a313 --- RELEASE-NOTES-1.35 | 1 + docs/hooks.txt | 5 ----- includes/parser/Parser.php | 4 ---- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/RELEASE-NOTES-1.35 b/RELEASE-NOTES-1.35 index 7ab9542abfb..fa7f3c08b4a 100644 --- a/RELEASE-NOTES-1.35 +++ b/RELEASE-NOTES-1.35 @@ -227,6 +227,7 @@ because of Phabricator reports. MediaWikiServices). * ApiBase::checkTitleUserPermissions no longer accepts a User as the third parameter. Passing a user was deprecated in 1.33. +* The ParserAfterUnstrip hook was removed without deprecation. * … === Deprecations in 1.35 === diff --git a/docs/hooks.txt b/docs/hooks.txt index 135c905a1de..7ee2a72047a 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -2536,11 +2536,6 @@ $parser: parser object $parser: Parser object being used &$text: text that will be returned -'ParserAfterUnstrip': Called after the first unstripGeneral() in -Parser::internalParseHalfParsed() -$parser: Parser object being used -&$text: text that will be returned - 'ParserBeforeInternalParse': Called at the beginning of Parser::internalParse(). $parser: Parser object &$text: text to parse diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 3e97b4d86c4..ad645bedc1d 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -1529,10 +1529,6 @@ class Parser { // Avoid PHP 7.1 warning from passing $this by reference $parser = $this; - if ( $isMain ) { - Hooks::run( 'ParserAfterUnstrip', [ &$parser, &$text ] ); - } - # Clean up special characters, only run once, next-to-last before doBlockLevels $text = Sanitizer::armorFrenchSpaces( $text );