Remove unnecessary use of Parser

Change-Id: Ib86ed6300ae85d7d69557a11bbd8f7b409e11d6c
This commit is contained in:
C. Scott Ananian 2023-07-20 10:27:06 -04:00 committed by Bartosz Dziewoński
parent fce524c9f8
commit 0de3f468c3
2 changed files with 3 additions and 5 deletions

View file

@ -12,7 +12,6 @@ use MediaWiki\MediaWikiServices;
use MediaWiki\User\UserIdentity;
use MWExceptionHandler;
use MWTimestamp;
use Parser;
use ParserOutput;
use Sanitizer;
use Throwable;
@ -49,10 +48,9 @@ class CommentFormatter {
*
* @param string &$text Parser text output (modified by reference)
* @param ParserOutput $pout ParserOutput object for metadata, e.g. parser limit report
* @param Parser $parser
* @param Title $title
*/
public static function addDiscussionTools( string &$text, ParserOutput $pout, Parser $parser ): void {
$title = $parser->getTitle();
public static function addDiscussionTools( string &$text, ParserOutput $pout, Title $title ): void {
$start = microtime( true );
$requestId = null;

View file

@ -65,7 +65,7 @@ class ParserHooks implements
// the user doesn't have DiscussionTools features enabled.
if ( HookUtils::isAvailableForTitle( $title ) ) {
// This modifies $text
CommentFormatter::addDiscussionTools( $text, $pout, $parser );
CommentFormatter::addDiscussionTools( $text, $pout, $title );
if ( $parser->getOptions()->getIsPreview() ) {
$text = CommentFormatter::removeInteractiveTools( $text );