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 http://www.gnu.org/copyleft/gpl.html GNU General Public License 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() . '/*';
56 if ( isset( $wgLogActionsHandlers[$fulltype] ) ) {
57 $handler = $wgLogActionsHandlers[$fulltype];
58 } elseif ( isset( $wgLogActionsHandlers[$wildcard] ) ) {
59 $handler = $wgLogActionsHandlers[$wildcard];
62 if ( $handler !== '' && is_string( $handler ) && class_exists( $handler ) ) {
63 return new $handler( $entry );
66 return new LegacyLogFormatter( $entry );
70 * Handy shortcut for constructing a formatter directly from
72 * @param stdClass|array $row
73 * @see DatabaseLogEntry::getSelectQueryData
74 * @return LogFormatter
76 public static function newFromRow( $row ) {
77 return self
::newFromEntry( DatabaseLogEntry
::newFromRow( $row ) );
82 /** @var LogEntryBase */
85 /** @var int Constant for handling log_deleted */
86 protected $audience = self
::FOR_PUBLIC
;
88 /** @var IContextSource Context for logging */
91 /** @var bool Whether to output user tool links */
92 protected $linkFlood = false;
95 * Set to true if we are constructing a message text that is going to
96 * be included in page history or send to IRC feed. Links are replaced
97 * with plaintext or with [[pagename]] kind of syntax, that is parsed
98 * by page histories and IRC feeds.
101 protected $plaintext = false;
104 protected $irctext = false;
107 * @var LinkRenderer|null
109 private $linkRenderer;
112 * @see LogFormatter::getMessageParameters
115 protected $parsedParameters;
117 protected function __construct( LogEntry
$entry ) {
118 $this->entry
= $entry;
119 $this->context
= RequestContext
::getMain();
123 * Replace the default context
124 * @param IContextSource $context
126 public function setContext( IContextSource
$context ) {
127 $this->context
= $context;
132 * @param LinkRenderer $linkRenderer
134 public function setLinkRenderer( LinkRenderer
$linkRenderer ) {
135 $this->linkRenderer
= $linkRenderer;
140 * @return LinkRenderer
142 public function getLinkRenderer() {
143 if ( $this->linkRenderer
!== null ) {
144 return $this->linkRenderer
;
146 return MediaWikiServices
::getInstance()->getLinkRenderer();
151 * Set the visibility restrictions for displaying content.
152 * If set to public, and an item is deleted, then it will be replaced
153 * with a placeholder even if the context user is allowed to view it.
154 * @param int $audience Const self::FOR_THIS_USER or self::FOR_PUBLIC
156 public function setAudience( $audience ) {
157 $this->audience
= ( $audience == self
::FOR_THIS_USER
)
158 ? self
::FOR_THIS_USER
163 * Check if a log item can be displayed
164 * @param int $field LogPage::DELETED_* constant
167 protected function canView( $field ) {
168 if ( $this->audience
== self
::FOR_THIS_USER
) {
169 return LogEventsList
::userCanBitfield(
170 $this->entry
->getDeleted(), $field, $this->context
->getUser() );
172 return !$this->entry
->isDeleted( $field );
177 * If set to true, will produce user tool links after
178 * the user name. This should be replaced with generic
182 public function setShowUserToolLinks( $value ) {
183 $this->linkFlood
= $value;
187 * Ugly hack to produce plaintext version of the message.
188 * Usually you also want to set extraneous request context
189 * to avoid formatting for any particular user.
190 * @see getActionText()
191 * @return string Plain text
193 public function getPlainActionText() {
194 $this->plaintext
= true;
195 $text = $this->getActionText();
196 $this->plaintext
= false;
202 * Even uglier hack to maintain backwards compatibility with IRC bots
204 * @see getActionText()
205 * @return string Text
207 public function getIRCActionComment() {
208 $actionComment = $this->getIRCActionText();
209 $comment = $this->entry
->getComment();
211 if ( $comment != '' ) {
212 if ( $actionComment == '' ) {
213 $actionComment = $comment;
215 $actionComment .= wfMessage( 'colon-separator' )->inContentLanguage()->text() . $comment;
219 return $actionComment;
223 * Even uglier hack to maintain backwards compatibility with IRC bots
225 * @see getActionText()
226 * @return string Text
228 public function getIRCActionText() {
231 $this->plaintext
= true;
232 $this->irctext
= true;
234 $entry = $this->entry
;
235 $parameters = $entry->getParameters();
236 // @see LogPage::actionText()
237 // Text of title the action is aimed at.
238 $target = $entry->getTarget()->getPrefixedText();
240 switch ( $entry->getType() ) {
242 switch ( $entry->getSubtype() ) {
244 $movesource = $parameters['4::target'];
245 $text = wfMessage( '1movedto2' )
246 ->rawParams( $target, $movesource )->inContentLanguage()->escaped();
249 $movesource = $parameters['4::target'];
250 $text = wfMessage( '1movedto2_redir' )
251 ->rawParams( $target, $movesource )->inContentLanguage()->escaped();
253 case 'move-noredirect':
255 case 'move_redir-noredirect':
261 switch ( $entry->getSubtype() ) {
263 $text = wfMessage( 'deletedarticle' )
264 ->rawParams( $target )->inContentLanguage()->escaped();
267 $text = wfMessage( 'undeletedarticle' )
268 ->rawParams( $target )->inContentLanguage()->escaped();
270 //case 'revision': // Revision deletion
271 //case 'event': // Log deletion
272 // see https://github.com/wikimedia/mediawiki/commit/a9c243b7b5289dad204278dbe7ed571fd914e395
278 // https://github.com/wikimedia/mediawiki/commit/1a05f8faf78675dc85984f27f355b8825b43efff
279 // Create a diff link to the patrolled revision
280 if ( $entry->getSubtype() === 'patrol' ) {
281 $diffLink = htmlspecialchars(
282 wfMessage( 'patrol-log-diff', $parameters['4::curid'] )
283 ->inContentLanguage()->text() );
284 $text = wfMessage( 'patrol-log-line', $diffLink, "[[$target]]", "" )
285 ->inContentLanguage()->text();
292 switch ( $entry->getSubtype() ) {
294 $text = wfMessage( 'protectedarticle' )
295 ->rawParams( $target . ' ' . $parameters['4::description'] )->inContentLanguage()->escaped();
298 $text = wfMessage( 'unprotectedarticle' )
299 ->rawParams( $target )->inContentLanguage()->escaped();
302 $text = wfMessage( 'modifiedarticleprotection' )
303 ->rawParams( $target . ' ' . $parameters['4::description'] )->inContentLanguage()->escaped();
306 $text = wfMessage( 'movedarticleprotection' )
307 ->rawParams( $target, $parameters['4::oldtitle'] )->inContentLanguage()->escaped();
313 switch ( $entry->getSubtype() ) {
316 $text = wfMessage( 'newuserlog-create-entry' )
317 ->inContentLanguage()->escaped();
321 $text = wfMessage( 'newuserlog-create2-entry' )
322 ->rawParams( $target )->inContentLanguage()->escaped();
325 $text = wfMessage( 'newuserlog-autocreate-entry' )
326 ->inContentLanguage()->escaped();
332 switch ( $entry->getSubtype() ) {
334 $text = wfMessage( 'uploadedimage' )
335 ->rawParams( $target )->inContentLanguage()->escaped();
338 $text = wfMessage( 'overwroteimage' )
339 ->rawParams( $target )->inContentLanguage()->escaped();
345 if ( count( $parameters['4::oldgroups'] ) ) {
346 $oldgroups = implode( ', ', $parameters['4::oldgroups'] );
348 $oldgroups = wfMessage( 'rightsnone' )->inContentLanguage()->escaped();
350 if ( count( $parameters['5::newgroups'] ) ) {
351 $newgroups = implode( ', ', $parameters['5::newgroups'] );
353 $newgroups = wfMessage( 'rightsnone' )->inContentLanguage()->escaped();
355 switch ( $entry->getSubtype() ) {
357 $text = wfMessage( 'rightslogentry' )
358 ->rawParams( $target, $oldgroups, $newgroups )->inContentLanguage()->escaped();
361 $text = wfMessage( 'rightslogentry-autopromote' )
362 ->rawParams( $target, $oldgroups, $newgroups )->inContentLanguage()->escaped();
368 $text = wfMessage( 'pagemerge-logentry' )
369 ->rawParams( $target, $parameters['4::dest'], $parameters['5::mergepoint'] )
370 ->inContentLanguage()->escaped();
374 switch ( $entry->getSubtype() ) {
376 // Keep compatibility with extensions by checking for
377 // new key (5::duration/6::flags) or old key (0/optional 1)
378 if ( $entry->isLegacy() ) {
379 $rawDuration = $parameters[0];
380 $rawFlags = isset( $parameters[1] ) ?
$parameters[1] : '';
382 $rawDuration = $parameters['5::duration'];
383 $rawFlags = $parameters['6::flags'];
385 $duration = $wgContLang->translateBlockExpiry(
388 wfTimestamp( TS_UNIX
, $entry->getTimestamp() )
390 $flags = BlockLogFormatter
::formatBlockFlags( $rawFlags, $wgContLang );
391 $text = wfMessage( 'blocklogentry' )
392 ->rawParams( $target, $duration, $flags )->inContentLanguage()->escaped();
395 $text = wfMessage( 'unblocklogentry' )
396 ->rawParams( $target )->inContentLanguage()->escaped();
399 $duration = $wgContLang->translateBlockExpiry(
400 $parameters['5::duration'],
402 wfTimestamp( TS_UNIX
, $entry->getTimestamp() )
404 $flags = BlockLogFormatter
::formatBlockFlags( $parameters['6::flags'], $wgContLang );
405 $text = wfMessage( 'reblock-logentry' )
406 ->rawParams( $target, $duration, $flags )->inContentLanguage()->escaped();
412 switch ( $entry->getSubtype() ) {
414 $text = wfMessage( 'import-logentry-upload' )
415 ->rawParams( $target )->inContentLanguage()->escaped();
418 $text = wfMessage( 'import-logentry-interwiki' )
419 ->rawParams( $target )->inContentLanguage()->escaped();
423 // case 'suppress' --private log -- aaron (so we know who to blame in a few years :-D)
426 if ( is_null( $text ) ) {
427 $text = $this->getPlainActionText();
430 $this->plaintext
= false;
431 $this->irctext
= false;
437 * Gets the log action, including username.
438 * @return string HTML
440 public function getActionText() {
441 if ( $this->canView( LogPage
::DELETED_ACTION
) ) {
442 $element = $this->getActionMessage();
443 if ( $element instanceof Message
) {
444 $element = $this->plaintext ?
$element->text() : $element->escaped();
446 if ( $this->entry
->isDeleted( LogPage
::DELETED_ACTION
) ) {
447 $element = $this->styleRestricedElement( $element );
450 $sep = $this->msg( 'word-separator' );
451 $sep = $this->plaintext ?
$sep->text() : $sep->escaped();
452 $performer = $this->getPerformerElement();
453 $element = $performer . $sep . $this->getRestrictedElement( 'rev-deleted-event' );
460 * Returns a sentence describing the log action. Usually
461 * a Message object is returned, but old style log types
462 * and entries might return pre-escaped HTML string.
463 * @return Message|string Pre-escaped HTML
465 protected function getActionMessage() {
466 $message = $this->msg( $this->getMessageKey() );
467 $message->params( $this->getMessageParameters() );
473 * Returns a key to be used for formatting the action sentence.
474 * Default is logentry-TYPE-SUBTYPE for modern logs. Legacy log
475 * types will use custom keys, and subclasses can also alter the
476 * key depending on the entry itself.
477 * @return string Message key
479 protected function getMessageKey() {
480 $type = $this->entry
->getType();
481 $subtype = $this->entry
->getSubtype();
483 return "logentry-$type-$subtype";
487 * Returns extra links that comes after the action text, like "revert", etc.
491 public function getActionLinks() {
496 * Extracts the optional extra parameters for use in action messages.
497 * The array indexes start from number 3.
500 protected function extractParameters() {
501 $entry = $this->entry
;
504 if ( $entry->isLegacy() ) {
505 foreach ( $entry->getParameters() as $index => $value ) {
506 $params[$index +
3] = $value;
510 // Filter out parameters which are not in format #:foo
511 foreach ( $entry->getParameters() as $key => $value ) {
512 if ( strpos( $key, ':' ) === false ) {
515 list( $index, $type, ) = explode( ':', $key, 3 );
516 if ( ctype_digit( $index ) ) {
517 $params[$index - 1] = $this->formatParameterValue( $type, $value );
521 /* Message class doesn't like non consecutive numbering.
522 * Fill in missing indexes with empty strings to avoid
523 * incorrect renumbering.
525 if ( count( $params ) ) {
526 $max = max( array_keys( $params ) );
527 // index 0 to 2 are added in getMessageParameters
528 for ( $i = 3; $i < $max; $i++
) {
529 if ( !isset( $params[$i] ) ) {
539 * Formats parameters intented for action message from
540 * array of all parameters. There are three hardcoded
541 * parameters (array is zero-indexed, this list not):
542 * - 1: user name with premade link
543 * - 2: usable for gender magic function
544 * - 3: target page with premade link
547 protected function getMessageParameters() {
548 if ( isset( $this->parsedParameters
) ) {
549 return $this->parsedParameters
;
552 $entry = $this->entry
;
553 $params = $this->extractParameters();
554 $params[0] = Message
::rawParam( $this->getPerformerElement() );
555 $params[1] = $this->canView( LogPage
::DELETED_USER
) ?
$entry->getPerformer()->getName() : '';
556 $params[2] = Message
::rawParam( $this->makePageLink( $entry->getTarget() ) );
558 // Bad things happens if the numbers are not in correct order
561 $this->parsedParameters
= $params;
562 return $this->parsedParameters
;
566 * Formats parameters values dependent to their type
567 * @param string $type The type of the value.
568 * Valid are currently:
569 * * - (empty) or plain: The value is returned as-is
570 * * raw: The value will be added to the log message
571 * as raw parameter (e.g. no escaping)
572 * Use this only if there is no other working
573 * type like user-link or title-link
574 * * msg: The value is a message-key, the output is
575 * the message in user language
576 * * msg-content: The value is a message-key, the output
577 * is the message in content language
578 * * user: The value is a user name, e.g. for GENDER
579 * * user-link: The value is a user name, returns a
581 * * title: The value is a page title,
582 * returns name of page
583 * * title-link: The value is a page title,
584 * returns link to this page
585 * * number: Format value as number
586 * * list: Format value as a comma-separated list
587 * @param mixed $value The parameter value that should be formatted
588 * @return string|array Formated value
591 protected function formatParameterValue( $type, $value ) {
592 $saveLinkFlood = $this->linkFlood
;
594 switch ( strtolower( trim( $type ) ) ) {
596 $value = Message
::rawParam( $value );
599 $value = $this->context
->getLanguage()->commaList( $value );
602 $value = $this->msg( $value )->text();
605 $value = $this->msg( $value )->inContentLanguage()->text();
608 $value = Message
::numParam( $value );
611 $user = User
::newFromName( $value );
612 $value = $user->getName();
615 $this->setShowUserToolLinks( false );
617 $user = User
::newFromName( $value );
618 $value = Message
::rawParam( $this->makeUserLink( $user ) );
620 $this->setShowUserToolLinks( $saveLinkFlood );
623 $title = Title
::newFromText( $value );
624 $value = $title->getPrefixedText();
627 $title = Title
::newFromText( $value );
628 $value = Message
::rawParam( $this->makePageLink( $title ) );
631 // Plain text, nothing to do
633 // Catch other types and use the old behavior (return as-is)
640 * Helper to make a link to the page, taking the plaintext
641 * value in consideration.
642 * @param Title $title The page
643 * @param array $parameters Query parameters
644 * @param string|null $html Linktext of the link as raw html
645 * @throws MWException
648 protected function makePageLink( Title
$title = null, $parameters = [], $html = null ) {
649 if ( !$title instanceof Title
) {
650 throw new MWException( 'Expected title, got null' );
652 if ( !$this->plaintext
) {
653 $html = $html !== null ?
new HtmlArmor( $html ) : $html;
654 $link = $this->getLinkRenderer()->makeLink( $title, $html, [], $parameters );
656 $link = '[[' . $title->getPrefixedText() . ']]';
663 * Provides the name of the user who performed the log action.
664 * Used as part of log action message or standalone, depending
665 * which parts of the log entry has been hidden.
668 public function getPerformerElement() {
669 if ( $this->canView( LogPage
::DELETED_USER
) ) {
670 $performer = $this->entry
->getPerformer();
671 $element = $this->makeUserLink( $performer );
672 if ( $this->entry
->isDeleted( LogPage
::DELETED_USER
) ) {
673 $element = $this->styleRestricedElement( $element );
676 $element = $this->getRestrictedElement( 'rev-deleted-user' );
683 * Gets the user provided comment
684 * @return string HTML
686 public function getComment() {
687 if ( $this->canView( LogPage
::DELETED_COMMENT
) ) {
688 $comment = Linker
::commentBlock( $this->entry
->getComment() );
689 // No hard coded spaces thanx
690 $element = ltrim( $comment );
691 if ( $this->entry
->isDeleted( LogPage
::DELETED_COMMENT
) ) {
692 $element = $this->styleRestricedElement( $element );
695 $element = $this->getRestrictedElement( 'rev-deleted-comment' );
702 * Helper method for displaying restricted element.
703 * @param string $message
704 * @return string HTML or wiki text
706 protected function getRestrictedElement( $message ) {
707 if ( $this->plaintext
) {
708 return $this->msg( $message )->text();
711 $content = $this->msg( $message )->escaped();
712 $attribs = [ 'class' => 'history-deleted' ];
714 return Html
::rawElement( 'span', $attribs, $content );
718 * Helper method for styling restricted element.
719 * @param string $content
720 * @return string HTML or wiki text
722 protected function styleRestricedElement( $content ) {
723 if ( $this->plaintext
) {
726 $attribs = [ 'class' => 'history-deleted' ];
728 return Html
::rawElement( 'span', $attribs, $content );
732 * Shortcut for wfMessage which honors local context.
736 protected function msg( $key ) {
737 return $this->context
->msg( $key );
740 protected function makeUserLink( User
$user, $toolFlags = 0 ) {
741 if ( $this->plaintext
) {
742 $element = $user->getName();
744 $element = Linker
::userLink(
749 if ( $this->linkFlood
) {
750 $element .= Linker
::userToolLinks(
753 true, // redContribsWhenNoEdits
755 $user->getEditCount()
764 * @return array Array of titles that should be preloaded with LinkBatch
766 public function getPreloadTitles() {
771 * @return array Output of getMessageParameters() for testing
773 public function getMessageParametersForTesting() {
774 // This function was added because getMessageParameters() is
775 // protected and a change from protected to public caused
776 // problems with extensions
777 return $this->getMessageParameters();
781 * Get the array of parameters, converted from legacy format if necessary.
785 protected function getParametersForApi() {
786 return $this->entry
->getParameters();
790 * Format parameters for API output
792 * The result array should generally map named keys to values. Index and
793 * type should be omitted, e.g. "4::foo" should be returned as "foo" in the
794 * output. Values should generally be unformatted.
796 * Renames or removals of keys besides from the legacy numeric format to
797 * modern named style should be avoided. Any renames should be announced to
798 * the mediawiki-api-announce mailing list.
803 public function formatParametersForApi() {
805 foreach ( $this->getParametersForApi() as $key => $value ) {
806 $vals = explode( ':', $key, 3 );
807 if ( count( $vals ) !== 3 ) {
808 $logParams[$key] = $value;
811 $logParams +
= $this->formatParameterValueForApi( $vals[2], $vals[1], $value );
813 ApiResult
::setIndexedTagName( $logParams, 'param' );
814 ApiResult
::setArrayType( $logParams, 'assoc' );
820 * Format a single parameter value for API output
823 * @param string $name
824 * @param string $type
825 * @param string $value
828 protected function formatParameterValueForApi( $name, $type, $value ) {
829 $type = strtolower( trim( $type ) );
832 $value = (bool)$value;
836 if ( ctype_digit( $value ) ||
is_int( $value ) ) {
837 $value = (int)$value;
839 $value = (float)$value;
846 if ( is_array( $value ) ) {
847 ApiResult
::setArrayType( $value, $type );
852 $value = wfTimestamp( TS_ISO_8601
, $value );
857 $msg = $this->msg( $value );
858 if ( $type === 'msg-content' ) {
859 $msg->inContentLanguage();
862 $value["{$name}_key"] = $msg->getKey();
863 if ( $msg->getParams() ) {
864 $value["{$name}_params"] = $msg->getParams();
866 $value["{$name}_text"] = $msg->text();
871 $title = Title
::newFromText( $value );
873 // Huh? Do something halfway sane.
874 $title = SpecialPage
::getTitleFor( 'Badtitle', $value );
877 ApiQueryBase
::addTitleInfo( $value, $title, "{$name}_" );
882 $user = User
::newFromName( $value );
884 $value = $user->getName();
893 return [ $name => $value ];
898 * This class formats all log entries for log types
899 * which have not been converted to the new system.
900 * This is not about old log entries which store
901 * parameters in a different format - the new
902 * LogFormatter classes have code to support formatting
906 class LegacyLogFormatter
extends LogFormatter
{
908 * Backward compatibility for extension changing the comment from
909 * the LogLine hook. This will be set by the first call on getComment(),
910 * then it might be modified by the hook when calling getActionLinks(),
911 * so that the modified value will be returned when calling getComment()
916 private $comment = null;
919 * Cache for the result of getActionLinks() so that it does not need to
920 * run multiple times depending on the order that getComment() and
921 * getActionLinks() are called.
925 private $revert = null;
927 public function getComment() {
928 if ( $this->comment
=== null ) {
929 $this->comment
= parent
::getComment();
932 // Make sure we execute the LogLine hook so that we immediately return
933 // the correct value.
934 if ( $this->revert
=== null ) {
935 $this->getActionLinks();
938 return $this->comment
;
941 protected function getActionMessage() {
942 $entry = $this->entry
;
943 $action = LogPage
::actionText(
945 $entry->getSubtype(),
947 $this->plaintext ?
null : $this->context
->getSkin(),
948 (array)$entry->getParameters(),
949 !$this->plaintext
// whether to filter [[]] links
952 $performer = $this->getPerformerElement();
953 if ( !$this->irctext
) {
954 $sep = $this->msg( 'word-separator' );
955 $sep = $this->plaintext ?
$sep->text() : $sep->escaped();
956 $action = $performer . $sep . $action;
962 public function getActionLinks() {
963 if ( $this->revert
!== null ) {
964 return $this->revert
;
967 if ( $this->entry
->isDeleted( LogPage
::DELETED_ACTION
) ) {
969 return $this->revert
;
972 $title = $this->entry
->getTarget();
973 $type = $this->entry
->getType();
974 $subtype = $this->entry
->getSubtype();
976 // Do nothing. The implementation is handled by the hook modifiying the
977 // passed-by-ref parameters. This also changes the default value so that
978 // getComment() and getActionLinks() do not call them indefinitely.
981 // This is to populate the $comment member of this instance so that it
982 // can be modified when calling the hook just below.
983 if ( $this->comment
=== null ) {
987 $params = $this->entry
->getParameters();
989 Hooks
::run( 'LogLine', [ $type, $subtype, $title, $params,
990 &$this->comment
, &$this->revert
, $this->entry
->getTimestamp() ] );
992 return $this->revert
;