mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-12-18 02:51:26 +00:00
Remove unnecessary use of Parser
Change-Id: Ib86ed6300ae85d7d69557a11bbd8f7b409e11d6c
This commit is contained in:
parent
fce524c9f8
commit
0de3f468c3
|
@ -12,7 +12,6 @@ use MediaWiki\MediaWikiServices;
|
||||||
use MediaWiki\User\UserIdentity;
|
use MediaWiki\User\UserIdentity;
|
||||||
use MWExceptionHandler;
|
use MWExceptionHandler;
|
||||||
use MWTimestamp;
|
use MWTimestamp;
|
||||||
use Parser;
|
|
||||||
use ParserOutput;
|
use ParserOutput;
|
||||||
use Sanitizer;
|
use Sanitizer;
|
||||||
use Throwable;
|
use Throwable;
|
||||||
|
@ -49,10 +48,9 @@ class CommentFormatter {
|
||||||
*
|
*
|
||||||
* @param string &$text Parser text output (modified by reference)
|
* @param string &$text Parser text output (modified by reference)
|
||||||
* @param ParserOutput $pout ParserOutput object for metadata, e.g. parser limit report
|
* @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 {
|
public static function addDiscussionTools( string &$text, ParserOutput $pout, Title $title ): void {
|
||||||
$title = $parser->getTitle();
|
|
||||||
$start = microtime( true );
|
$start = microtime( true );
|
||||||
$requestId = null;
|
$requestId = null;
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ class ParserHooks implements
|
||||||
// the user doesn't have DiscussionTools features enabled.
|
// the user doesn't have DiscussionTools features enabled.
|
||||||
if ( HookUtils::isAvailableForTitle( $title ) ) {
|
if ( HookUtils::isAvailableForTitle( $title ) ) {
|
||||||
// This modifies $text
|
// This modifies $text
|
||||||
CommentFormatter::addDiscussionTools( $text, $pout, $parser );
|
CommentFormatter::addDiscussionTools( $text, $pout, $title );
|
||||||
|
|
||||||
if ( $parser->getOptions()->getIsPreview() ) {
|
if ( $parser->getOptions()->getIsPreview() ) {
|
||||||
$text = CommentFormatter::removeInteractiveTools( $text );
|
$text = CommentFormatter::removeInteractiveTools( $text );
|
||||||
|
|
Loading…
Reference in a new issue