3 * Contains classes for formatting log entries
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
21 * @author Niklas Laxström
22 * @license GPL-2.0-or-later
25 use MediaWiki\Linker\LinkRenderer
;
26 use MediaWiki\MediaWikiServices
;
29 * Implements the default log formatting.
31 * Can be overridden by subclassing and setting:
33 * $wgLogActionsHandlers['type/subtype'] = 'class'; or
34 * $wgLogActionsHandlers['type/*'] = 'class';
39 // Audience options for viewing usernames, comments, and actions
41 const FOR_THIS_USER
= 2;
46 * Constructs a new formatter suitable for given entry.
47 * @param LogEntry $entry
48 * @return LogFormatter
50 public static function newFromEntry( LogEntry
$entry ) {
51 global $wgLogActionsHandlers;
52 $fulltype = $entry->getFullType();
53 $wildcard = $entry->getType() . '/*';
54 $handler = $wgLogActionsHandlers[$fulltype] ??
$wgLogActionsHandlers[$wildcard] ??
'';
56 if ( $handler !== '' && is_string( $handler ) && class_exists( $handler ) ) {
57 return new $handler( $entry );
60 return new LegacyLogFormatter( $entry );
64 * Handy shortcut for constructing a formatter directly from
66 * @param stdClass|array $row
67 * @see DatabaseLogEntry::getSelectQueryData
68 * @return LogFormatter
70 public static function newFromRow( $row ) {
71 return self
::newFromEntry( DatabaseLogEntry
::newFromRow( $row ) );
76 /** @var LogEntryBase */
79 /** @var int Constant for handling log_deleted */
80 protected $audience = self
::FOR_PUBLIC
;
82 /** @var IContextSource Context for logging */
85 /** @var bool Whether to output user tool links */
86 protected $linkFlood = false;
89 * Set to true if we are constructing a message text that is going to
90 * be included in page history or send to IRC feed. Links are replaced
91 * with plaintext or with [[pagename]] kind of syntax, that is parsed
92 * by page histories and IRC feeds.
95 protected $plaintext = false;
98 protected $irctext = false;
101 * @var LinkRenderer|null
103 private $linkRenderer;
106 * @see LogFormatter::getMessageParameters
109 protected $parsedParameters;
111 protected function __construct( LogEntry
$entry ) {
112 $this->entry
= $entry;
113 $this->context
= RequestContext
::getMain();
117 * Replace the default context
118 * @param IContextSource $context
120 public function setContext( IContextSource
$context ) {
121 $this->context
= $context;
126 * @param LinkRenderer $linkRenderer
128 public function setLinkRenderer( LinkRenderer
$linkRenderer ) {
129 $this->linkRenderer
= $linkRenderer;
134 * @return LinkRenderer
136 public function getLinkRenderer() {
137 if ( $this->linkRenderer
!== null ) {
138 return $this->linkRenderer
;
140 return MediaWikiServices
::getInstance()->getLinkRenderer();
145 * Set the visibility restrictions for displaying content.
146 * If set to public, and an item is deleted, then it will be replaced
147 * with a placeholder even if the context user is allowed to view it.
148 * @param int $audience Const self::FOR_THIS_USER or self::FOR_PUBLIC
150 public function setAudience( $audience ) {
151 $this->audience
= ( $audience == self
::FOR_THIS_USER
)
152 ? self
::FOR_THIS_USER
157 * Check if a log item can be displayed
158 * @param int $field LogPage::DELETED_* constant
161 protected function canView( $field ) {
162 if ( $this->audience
== self
::FOR_THIS_USER
) {
163 return LogEventsList
::userCanBitfield(
164 $this->entry
->getDeleted(), $field, $this->context
->getUser() );
166 return !$this->entry
->isDeleted( $field );
171 * If set to true, will produce user tool links after
172 * the user name. This should be replaced with generic
176 public function setShowUserToolLinks( $value ) {
177 $this->linkFlood
= $value;
181 * Ugly hack to produce plaintext version of the message.
182 * Usually you also want to set extraneous request context
183 * to avoid formatting for any particular user.
184 * @see getActionText()
185 * @return string Plain text
186 * @return-taint tainted
188 public function getPlainActionText() {
189 $this->plaintext
= true;
190 $text = $this->getActionText();
191 $this->plaintext
= false;
197 * Even uglier hack to maintain backwards compatibility with IRC bots
199 * @see getActionText()
200 * @return string Text
202 public function getIRCActionComment() {
203 $actionComment = $this->getIRCActionText();
204 $comment = $this->entry
->getComment();
206 if ( $comment != '' ) {
207 if ( $actionComment == '' ) {
208 $actionComment = $comment;
210 $actionComment .= wfMessage( 'colon-separator' )->inContentLanguage()->text() . $comment;
214 return $actionComment;
218 * Even uglier hack to maintain backwards compatibility with IRC bots
220 * @see getActionText()
221 * @return string Text
223 public function getIRCActionText() {
224 $this->plaintext
= true;
225 $this->irctext
= true;
227 $entry = $this->entry
;
228 $parameters = $entry->getParameters();
229 // @see LogPage::actionText()
230 // Text of title the action is aimed at.
231 $target = $entry->getTarget()->getPrefixedText();
233 $contLang = MediaWikiServices
::getInstance()->getContentLanguage();
234 switch ( $entry->getType() ) {
236 switch ( $entry->getSubtype() ) {
238 $movesource = $parameters['4::target'];
239 $text = wfMessage( '1movedto2' )
240 ->rawParams( $target, $movesource )->inContentLanguage()->escaped();
243 $movesource = $parameters['4::target'];
244 $text = wfMessage( '1movedto2_redir' )
245 ->rawParams( $target, $movesource )->inContentLanguage()->escaped();
247 case 'move-noredirect':
249 case 'move_redir-noredirect':
255 switch ( $entry->getSubtype() ) {
257 $text = wfMessage( 'deletedarticle' )
258 ->rawParams( $target )->inContentLanguage()->escaped();
261 $text = wfMessage( 'undeletedarticle' )
262 ->rawParams( $target )->inContentLanguage()->escaped();
264 //case 'revision': // Revision deletion
265 //case 'event': // Log deletion
266 // see https://github.com/wikimedia/mediawiki/commit/a9c243b7b5289dad204278dbe7ed571fd914e395
272 // https://github.com/wikimedia/mediawiki/commit/1a05f8faf78675dc85984f27f355b8825b43efff
273 // Create a diff link to the patrolled revision
274 if ( $entry->getSubtype() === 'patrol' ) {
275 $diffLink = htmlspecialchars(
276 wfMessage( 'patrol-log-diff', $parameters['4::curid'] )
277 ->inContentLanguage()->text() );
278 $text = wfMessage( 'patrol-log-line', $diffLink, "[[$target]]", "" )
279 ->inContentLanguage()->text();
286 switch ( $entry->getSubtype() ) {
288 $text = wfMessage( 'protectedarticle' )
289 ->rawParams( $target . ' ' . $parameters['4::description'] )->inContentLanguage()->escaped();
292 $text = wfMessage( 'unprotectedarticle' )
293 ->rawParams( $target )->inContentLanguage()->escaped();
296 $text = wfMessage( 'modifiedarticleprotection' )
297 ->rawParams( $target . ' ' . $parameters['4::description'] )->inContentLanguage()->escaped();
300 $text = wfMessage( 'movedarticleprotection' )
301 ->rawParams( $target, $parameters['4::oldtitle'] )->inContentLanguage()->escaped();
307 switch ( $entry->getSubtype() ) {
310 $text = wfMessage( 'newuserlog-create-entry' )
311 ->inContentLanguage()->escaped();
315 $text = wfMessage( 'newuserlog-create2-entry' )
316 ->rawParams( $target )->inContentLanguage()->escaped();
319 $text = wfMessage( 'newuserlog-autocreate-entry' )
320 ->inContentLanguage()->escaped();
326 switch ( $entry->getSubtype() ) {
328 $text = wfMessage( 'uploadedimage' )
329 ->rawParams( $target )->inContentLanguage()->escaped();
332 $text = wfMessage( 'overwroteimage' )
333 ->rawParams( $target )->inContentLanguage()->escaped();
339 if ( count( $parameters['4::oldgroups'] ) ) {
340 $oldgroups = implode( ', ', $parameters['4::oldgroups'] );
342 $oldgroups = wfMessage( 'rightsnone' )->inContentLanguage()->escaped();
344 if ( count( $parameters['5::newgroups'] ) ) {
345 $newgroups = implode( ', ', $parameters['5::newgroups'] );
347 $newgroups = wfMessage( 'rightsnone' )->inContentLanguage()->escaped();
349 switch ( $entry->getSubtype() ) {
351 $text = wfMessage( 'rightslogentry' )
352 ->rawParams( $target, $oldgroups, $newgroups )->inContentLanguage()->escaped();
355 $text = wfMessage( 'rightslogentry-autopromote' )
356 ->rawParams( $target, $oldgroups, $newgroups )->inContentLanguage()->escaped();
362 $text = wfMessage( 'pagemerge-logentry' )
363 ->rawParams( $target, $parameters['4::dest'], $parameters['5::mergepoint'] )
364 ->inContentLanguage()->escaped();
368 switch ( $entry->getSubtype() ) {
370 // Keep compatibility with extensions by checking for
371 // new key (5::duration/6::flags) or old key (0/optional 1)
372 if ( $entry->isLegacy() ) {
373 $rawDuration = $parameters[0];
374 $rawFlags = $parameters[1] ??
'';
376 $rawDuration = $parameters['5::duration'];
377 $rawFlags = $parameters['6::flags'];
379 $duration = $contLang->translateBlockExpiry(
382 wfTimestamp( TS_UNIX
, $entry->getTimestamp() )
384 $flags = BlockLogFormatter
::formatBlockFlags( $rawFlags, $contLang );
385 $text = wfMessage( 'blocklogentry' )
386 ->rawParams( $target, $duration, $flags )->inContentLanguage()->escaped();
389 $text = wfMessage( 'unblocklogentry' )
390 ->rawParams( $target )->inContentLanguage()->escaped();
393 $duration = $contLang->translateBlockExpiry(
394 $parameters['5::duration'],
396 wfTimestamp( TS_UNIX
, $entry->getTimestamp() )
398 $flags = BlockLogFormatter
::formatBlockFlags( $parameters['6::flags'],
400 $text = wfMessage( 'reblock-logentry' )
401 ->rawParams( $target, $duration, $flags )->inContentLanguage()->escaped();
407 switch ( $entry->getSubtype() ) {
409 $text = wfMessage( 'import-logentry-upload' )
410 ->rawParams( $target )->inContentLanguage()->escaped();
413 $text = wfMessage( 'import-logentry-interwiki' )
414 ->rawParams( $target )->inContentLanguage()->escaped();
418 // case 'suppress' --private log -- aaron (so we know who to blame in a few years :-D)
421 if ( is_null( $text ) ) {
422 $text = $this->getPlainActionText();
425 $this->plaintext
= false;
426 $this->irctext
= false;
432 * Gets the log action, including username.
433 * @return string HTML
434 * phan-taint-check gets very confused by $this->plaintext, so disable.
435 * @return-taint onlysafefor_html
437 public function getActionText() {
438 if ( $this->canView( LogPage
::DELETED_ACTION
) ) {
439 $element = $this->getActionMessage();
440 if ( $element instanceof Message
) {
441 $element = $this->plaintext ?
$element->text() : $element->escaped();
443 if ( $this->entry
->isDeleted( LogPage
::DELETED_ACTION
) ) {
444 $element = $this->styleRestricedElement( $element );
447 $sep = $this->msg( 'word-separator' );
448 $sep = $this->plaintext ?
$sep->text() : $sep->escaped();
449 $performer = $this->getPerformerElement();
450 $element = $performer . $sep . $this->getRestrictedElement( 'rev-deleted-event' );
457 * Returns a sentence describing the log action. Usually
458 * a Message object is returned, but old style log types
459 * and entries might return pre-escaped HTML string.
460 * @return Message|string Pre-escaped HTML
462 protected function getActionMessage() {
463 $message = $this->msg( $this->getMessageKey() );
464 $message->params( $this->getMessageParameters() );
470 * Returns a key to be used for formatting the action sentence.
471 * Default is logentry-TYPE-SUBTYPE for modern logs. Legacy log
472 * types will use custom keys, and subclasses can also alter the
473 * key depending on the entry itself.
474 * @return string Message key
476 protected function getMessageKey() {
477 $type = $this->entry
->getType();
478 $subtype = $this->entry
->getSubtype();
480 return "logentry-$type-$subtype";
484 * Returns extra links that comes after the action text, like "revert", etc.
488 public function getActionLinks() {
493 * Extracts the optional extra parameters for use in action messages.
494 * The array indexes start from number 3.
497 protected function extractParameters() {
498 $entry = $this->entry
;
501 if ( $entry->isLegacy() ) {
502 foreach ( $entry->getParameters() as $index => $value ) {
503 $params[$index +
3] = $value;
507 // Filter out parameters which are not in format #:foo
508 foreach ( $entry->getParameters() as $key => $value ) {
509 if ( strpos( $key, ':' ) === false ) {
512 list( $index, $type, ) = explode( ':', $key, 3 );
513 if ( ctype_digit( $index ) ) {
514 $params[$index - 1] = $this->formatParameterValue( $type, $value );
518 /* Message class doesn't like non consecutive numbering.
519 * Fill in missing indexes with empty strings to avoid
520 * incorrect renumbering.
522 if ( count( $params ) ) {
523 $max = max( array_keys( $params ) );
524 // index 0 to 2 are added in getMessageParameters
525 for ( $i = 3; $i < $max; $i++
) {
526 if ( !isset( $params[$i] ) ) {
536 * Formats parameters intented for action message from
537 * array of all parameters. There are three hardcoded
538 * parameters (array is zero-indexed, this list not):
539 * - 1: user name with premade link
540 * - 2: usable for gender magic function
541 * - 3: target page with premade link
544 protected function getMessageParameters() {
545 if ( isset( $this->parsedParameters
) ) {
546 return $this->parsedParameters
;
549 $entry = $this->entry
;
550 $params = $this->extractParameters();
551 $params[0] = Message
::rawParam( $this->getPerformerElement() );
552 $params[1] = $this->canView( LogPage
::DELETED_USER
) ?
$entry->getPerformer()->getName() : '';
553 $params[2] = Message
::rawParam( $this->makePageLink( $entry->getTarget() ) );
555 // Bad things happens if the numbers are not in correct order
558 $this->parsedParameters
= $params;
559 return $this->parsedParameters
;
563 * Formats parameters values dependent to their type
564 * @param string $type The type of the value.
565 * Valid are currently:
566 * * - (empty) or plain: The value is returned as-is
567 * * raw: The value will be added to the log message
568 * as raw parameter (e.g. no escaping)
569 * Use this only if there is no other working
570 * type like user-link or title-link
571 * * msg: The value is a message-key, the output is
572 * the message in user language
573 * * msg-content: The value is a message-key, the output
574 * is the message in content language
575 * * user: The value is a user name, e.g. for GENDER
576 * * user-link: The value is a user name, returns a
578 * * title: The value is a page title,
579 * returns name of page
580 * * title-link: The value is a page title,
581 * returns link to this page
582 * * number: Format value as number
583 * * list: Format value as a comma-separated list
584 * @param mixed $value The parameter value that should be formatted
585 * @return string|array Formated value
588 protected function formatParameterValue( $type, $value ) {
589 $saveLinkFlood = $this->linkFlood
;
591 switch ( strtolower( trim( $type ) ) ) {
593 $value = Message
::rawParam( $value );
596 $value = $this->context
->getLanguage()->commaList( $value );
599 $value = $this->msg( $value )->text();
602 $value = $this->msg( $value )->inContentLanguage()->text();
605 $value = Message
::numParam( $value );
608 $user = User
::newFromName( $value );
609 $value = $user->getName();
612 $this->setShowUserToolLinks( false );
614 $user = User
::newFromName( $value );
615 $value = Message
::rawParam( $this->makeUserLink( $user ) );
617 $this->setShowUserToolLinks( $saveLinkFlood );
620 $title = Title
::newFromText( $value );
621 $value = $title->getPrefixedText();
624 $title = Title
::newFromText( $value );
625 $value = Message
::rawParam( $this->makePageLink( $title ) );
628 // Plain text, nothing to do
630 // Catch other types and use the old behavior (return as-is)
637 * Helper to make a link to the page, taking the plaintext
638 * value in consideration.
639 * @param Title|null $title The page
640 * @param array $parameters Query parameters
641 * @param string|null $html Linktext of the link as raw html
644 protected function makePageLink( Title
$title = null, $parameters = [], $html = null ) {
645 if ( !$title instanceof Title
) {
646 $msg = $this->msg( 'invalidtitle' )->text();
647 if ( $this->plaintext
) {
650 return Html
::element( 'span', [ 'class' => 'mw-invalidtitle' ], $msg );
654 if ( $this->plaintext
) {
655 $link = '[[' . $title->getPrefixedText() . ']]';
657 $html = $html !== null ?
new HtmlArmor( $html ) : $html;
658 $link = $this->getLinkRenderer()->makeLink( $title, $html, [], $parameters );
665 * Provides the name of the user who performed the log action.
666 * Used as part of log action message or standalone, depending
667 * which parts of the log entry has been hidden.
670 public function getPerformerElement() {
671 if ( $this->canView( LogPage
::DELETED_USER
) ) {
672 $performer = $this->entry
->getPerformer();
673 $element = $this->makeUserLink( $performer );
674 if ( $this->entry
->isDeleted( LogPage
::DELETED_USER
) ) {
675 $element = $this->styleRestricedElement( $element );
678 $element = $this->getRestrictedElement( 'rev-deleted-user' );
685 * Gets the user provided comment
686 * @return string HTML
688 public function getComment() {
689 if ( $this->canView( LogPage
::DELETED_COMMENT
) ) {
690 $comment = Linker
::commentBlock( $this->entry
->getComment() );
691 // No hard coded spaces thanx
692 $element = ltrim( $comment );
693 if ( $this->entry
->isDeleted( LogPage
::DELETED_COMMENT
) ) {
694 $element = $this->styleRestricedElement( $element );
697 $element = $this->getRestrictedElement( 'rev-deleted-comment' );
704 * Helper method for displaying restricted element.
705 * @param string $message
706 * @return string HTML or wiki text
707 * @return-taint onlysafefor_html
709 protected function getRestrictedElement( $message ) {
710 if ( $this->plaintext
) {
711 return $this->msg( $message )->text();
714 $content = $this->msg( $message )->escaped();
715 $attribs = [ 'class' => 'history-deleted' ];
717 return Html
::rawElement( 'span', $attribs, $content );
721 * Helper method for styling restricted element.
722 * @param string $content
723 * @return string HTML or wiki text
725 protected function styleRestricedElement( $content ) {
726 if ( $this->plaintext
) {
729 $attribs = [ 'class' => 'history-deleted' ];
731 return Html
::rawElement( 'span', $attribs, $content );
735 * Shortcut for wfMessage which honors local context.
739 protected function msg( $key ) {
740 return $this->context
->msg( $key );
745 * @param int $toolFlags Combination of Linker::TOOL_LINKS_* flags
746 * @return string wikitext or html
747 * @return-taint onlysafefor_html
749 protected function makeUserLink( User
$user, $toolFlags = 0 ) {
750 if ( $this->plaintext
) {
751 $element = $user->getName();
753 $element = Linker
::userLink(
758 if ( $this->linkFlood
) {
759 $element .= Linker
::userToolLinks(
762 true, // redContribsWhenNoEdits
764 $user->getEditCount()
773 * @return array Array of titles that should be preloaded with LinkBatch
775 public function getPreloadTitles() {
780 * @return array Output of getMessageParameters() for testing
782 public function getMessageParametersForTesting() {
783 // This function was added because getMessageParameters() is
784 // protected and a change from protected to public caused
785 // problems with extensions
786 return $this->getMessageParameters();
790 * Get the array of parameters, converted from legacy format if necessary.
794 protected function getParametersForApi() {
795 return $this->entry
->getParameters();
799 * Format parameters for API output
801 * The result array should generally map named keys to values. Index and
802 * type should be omitted, e.g. "4::foo" should be returned as "foo" in the
803 * output. Values should generally be unformatted.
805 * Renames or removals of keys besides from the legacy numeric format to
806 * modern named style should be avoided. Any renames should be announced to
807 * the mediawiki-api-announce mailing list.
812 public function formatParametersForApi() {
814 foreach ( $this->getParametersForApi() as $key => $value ) {
815 $vals = explode( ':', $key, 3 );
816 if ( count( $vals ) !== 3 ) {
817 $logParams[$key] = $value;
820 $logParams +
= $this->formatParameterValueForApi( $vals[2], $vals[1], $value );
822 ApiResult
::setIndexedTagName( $logParams, 'param' );
823 ApiResult
::setArrayType( $logParams, 'assoc' );
829 * Format a single parameter value for API output
832 * @param string $name
833 * @param string $type
834 * @param string $value
837 protected function formatParameterValueForApi( $name, $type, $value ) {
838 $type = strtolower( trim( $type ) );
841 $value = (bool)$value;
845 if ( ctype_digit( $value ) ||
is_int( $value ) ) {
846 $value = (int)$value;
848 $value = (float)$value;
855 if ( is_array( $value ) ) {
856 ApiResult
::setArrayType( $value, $type );
861 $value = wfTimestamp( TS_ISO_8601
, $value );
866 $msg = $this->msg( $value );
867 if ( $type === 'msg-content' ) {
868 $msg->inContentLanguage();
871 $value["{$name}_key"] = $msg->getKey();
872 if ( $msg->getParams() ) {
873 $value["{$name}_params"] = $msg->getParams();
875 $value["{$name}_text"] = $msg->text();
880 $title = Title
::newFromText( $value );
882 // Huh? Do something halfway sane.
883 $title = SpecialPage
::getTitleFor( 'Badtitle', $value );
886 ApiQueryBase
::addTitleInfo( $value, $title, "{$name}_" );
891 $user = User
::newFromName( $value );
893 $value = $user->getName();
902 return [ $name => $value ];
907 * This class formats all log entries for log types
908 * which have not been converted to the new system.
909 * This is not about old log entries which store
910 * parameters in a different format - the new
911 * LogFormatter classes have code to support formatting
915 class LegacyLogFormatter
extends LogFormatter
{
917 * Backward compatibility for extension changing the comment from
918 * the LogLine hook. This will be set by the first call on getComment(),
919 * then it might be modified by the hook when calling getActionLinks(),
920 * so that the modified value will be returned when calling getComment()
925 private $comment = null;
928 * Cache for the result of getActionLinks() so that it does not need to
929 * run multiple times depending on the order that getComment() and
930 * getActionLinks() are called.
934 private $revert = null;
936 public function getComment() {
937 if ( $this->comment
=== null ) {
938 $this->comment
= parent
::getComment();
941 // Make sure we execute the LogLine hook so that we immediately return
942 // the correct value.
943 if ( $this->revert
=== null ) {
944 $this->getActionLinks();
947 return $this->comment
;
952 * @return-taint onlysafefor_html
954 protected function getActionMessage() {
955 $entry = $this->entry
;
956 $action = LogPage
::actionText(
958 $entry->getSubtype(),
960 $this->plaintext ?
null : $this->context
->getSkin(),
961 (array)$entry->getParameters(),
962 !$this->plaintext
// whether to filter [[]] links
965 $performer = $this->getPerformerElement();
966 if ( !$this->irctext
) {
967 $sep = $this->msg( 'word-separator' );
968 $sep = $this->plaintext ?
$sep->text() : $sep->escaped();
969 $action = $performer . $sep . $action;
975 public function getActionLinks() {
976 if ( $this->revert
!== null ) {
977 return $this->revert
;
980 if ( $this->entry
->isDeleted( LogPage
::DELETED_ACTION
) ) {
982 return $this->revert
;
985 $title = $this->entry
->getTarget();
986 $type = $this->entry
->getType();
987 $subtype = $this->entry
->getSubtype();
989 // Do nothing. The implementation is handled by the hook modifiying the
990 // passed-by-ref parameters. This also changes the default value so that
991 // getComment() and getActionLinks() do not call them indefinitely.
994 // This is to populate the $comment member of this instance so that it
995 // can be modified when calling the hook just below.
996 if ( $this->comment
=== null ) {
1000 $params = $this->entry
->getParameters();
1002 Hooks
::run( 'LogLine', [ $type, $subtype, $title, $params,
1003 &$this->comment
, &$this->revert
, $this->entry
->getTimestamp() ] );
1005 return $this->revert
;