comment === null ) { $this->comment = parent::getComment(); } // Make sure we execute the LogLine hook so that we immediately return // the correct value. if ( $this->revert === null ) { $this->getActionLinks(); } return $this->comment; } /** * @return string * @return-taint onlysafefor_html */ protected function getActionMessage() { $entry = $this->entry; $action = LogPage::actionText( $entry->getType(), $entry->getSubtype(), $entry->getTarget(), $this->plaintext ? null : $this->context->getSkin(), (array)$entry->getParameters(), !$this->plaintext // whether to filter [[]] links ); $performer = $this->getPerformerElement(); if ( !$this->irctext ) { $sep = $this->msg( 'word-separator' ); $sep = $this->plaintext ? $sep->text() : $sep->escaped(); $action = $performer . $sep . $action; } return $action; } public function getActionLinks() { if ( $this->revert !== null ) { return $this->revert; } if ( $this->entry->isDeleted( LogPage::DELETED_ACTION ) ) { $this->revert = ''; return $this->revert; } $title = $this->entry->getTarget(); $type = $this->entry->getType(); $subtype = $this->entry->getSubtype(); // Do nothing. The implementation is handled by the hook modifiying the // passed-by-ref parameters. This also changes the default value so that // getComment() and getActionLinks() do not call them indefinitely. $this->revert = ''; // This is to populate the $comment member of this instance so that it // can be modified when calling the hook just below. if ( $this->comment === null ) { $this->getComment(); } $params = $this->entry->getParameters(); Hooks::run( 'LogLine', [ $type, $subtype, $title, $params, &$this->comment, &$this->revert, $this->entry->getTimestamp() ] ); return $this->revert; } }