5 * Split off from Article.php and Skin.php, 2003-12-22
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * http://www.gnu.org/copyleft/gpl.html
27 * This class handles printing the history page for an article. In order to
28 * be efficient, it uses timestamps rather than offsets for paging, to avoid
29 * costly LIMIT,offset queries.
31 * Construct it by passing in an Article, and call $h->history() to print the
36 class HistoryAction
extends FormlessAction
{
40 /** @var array Array of message keys and strings */
43 public function getName() {
47 public function requiresWrite() {
51 public function requiresUnblock() {
55 protected function getPageTitle() {
56 return $this->msg( 'history-title', $this->getTitle()->getPrefixedText() )->text();
59 protected function getDescription() {
60 // Creation of a subtitle link pointing to [[Special:Log]]
61 return Linker
::linkKnown(
62 SpecialPage
::getTitleFor( 'Log' ),
63 $this->msg( 'viewpagelogs' )->escaped(),
65 array( 'page' => $this->getTitle()->getPrefixedText() )
70 * Get the Article object we are working on.
73 public function getArticle() {
78 * As we use the same small set of messages in various methods and that
79 * they are called often, we call them once and save them in $this->message
81 private function preCacheMessages() {
82 // Precache various messages
83 if ( !isset( $this->message
) ) {
84 $msgs = array( 'cur', 'last', 'pipe-separator' );
85 foreach ( $msgs as $msg ) {
86 $this->message
[$msg] = $this->msg( $msg )->escaped();
92 * Print the history page for an article.
95 global $wgScript, $wgUseFileCache;
97 $out = $this->getOutput();
98 $request = $this->getRequest();
101 * Allow client caching.
103 if ( $out->checkLastModified( $this->page
->getTouched() ) ) {
104 return; // Client cache fresh and headers sent, nothing more to do.
107 wfProfileIn( __METHOD__
);
109 $this->preCacheMessages();
111 # Fill in the file cache if not set already
112 if ( $wgUseFileCache && HTMLFileCache
::useFileCache( $this->getContext() ) ) {
113 $cache = HTMLFileCache
::newFromTitle( $this->getTitle(), 'history' );
114 if ( !$cache->isCacheGood( /* Assume up to date */ ) ) {
115 ob_start( array( &$cache, 'saveToFileCache' ) );
119 // Setup page variables.
120 $out->setFeedAppendQuery( 'action=history' );
121 $out->addModules( 'mediawiki.action.history' );
123 // Handle atom/RSS feeds.
124 $feedType = $request->getVal( 'feed' );
126 $this->feed( $feedType );
127 wfProfileOut( __METHOD__
);
132 // Fail nicely if article doesn't exist.
133 if ( !$this->page
->exists() ) {
134 $out->addWikiMsg( 'nohistory' );
135 # show deletion/move log if there is an entry
136 LogEventsList
::showLogExtract(
138 array( 'delete', 'move' ),
142 'conds' => array( "log_action != 'revision'" ),
143 'showIfEmpty' => false,
144 'msgKey' => array( 'moveddeleted-notice' )
147 wfProfileOut( __METHOD__
);
153 * Add date selector to quickly get to a certain time
155 $year = $request->getInt( 'year' );
156 $month = $request->getInt( 'month' );
157 $tagFilter = $request->getVal( 'tagfilter' );
158 $tagSelector = ChangeTags
::buildTagFilterSelector( $tagFilter );
161 * Option to show only revisions that have been (partially) hidden via RevisionDelete
163 if ( $request->getBool( 'deleted' ) ) {
164 $conds = array( 'rev_deleted != 0' );
168 if ( $this->getUser()->isAllowed( 'deletedhistory' ) ) {
169 $checkDeleted = Xml
::checkLabel( $this->msg( 'history-show-deleted' )->text(),
170 'deleted', 'mw-show-deleted-only', $request->getBool( 'deleted' ) ) . "\n";
175 // Add the general form
176 $action = htmlspecialchars( $wgScript );
178 "<form action=\"$action\" method=\"get\" id=\"mw-history-searchform\">" .
180 $this->msg( 'history-fieldset-title' )->text(),
182 array( 'id' => 'mw-history-search' )
184 Html
::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . "\n" .
185 Html
::hidden( 'action', 'history' ) . "\n" .
187 ( $year == null ? MWTimestamp
::getLocalInstance()->format( 'Y' ) : $year ),
190 ( $tagSelector ?
( implode( ' ', $tagSelector ) . ' ' ) : '' ) .
192 Xml
::submitButton( $this->msg( 'allpagessubmit' )->text() ) . "\n" .
196 wfRunHooks( 'PageHistoryBeforeList', array( &$this->page
, $this->getContext() ) );
198 // Create and output the list.
199 $pager = new HistoryPager( $this, $year, $month, $tagFilter, $conds );
201 $pager->getNavigationBar() .
203 $pager->getNavigationBar()
205 $out->preventClickjacking( $pager->getPreventClickjacking() );
207 wfProfileOut( __METHOD__
);
211 * Fetch an array of revisions, specified by a given limit, offset and
212 * direction. This is now only used by the feeds. It was previously
213 * used by the main UI but that's now handled by the pager.
215 * @param int $limit The limit number of revisions to get
217 * @param int $direction Either HistoryPage::DIR_PREV or HistoryPage::DIR_NEXT
218 * @return ResultWrapper
220 function fetchRevisions( $limit, $offset, $direction ) {
221 // Fail if article doesn't exist.
222 if ( !$this->getTitle()->exists() ) {
223 return new FakeResultWrapper( array() );
226 $dbr = wfGetDB( DB_SLAVE
);
228 if ( $direction == HistoryPage
::DIR_PREV
) {
229 list( $dirs, $oper ) = array( "ASC", ">=" );
230 } else { /* $direction == HistoryPage::DIR_NEXT */
231 list( $dirs, $oper ) = array( "DESC", "<=" );
235 $offsets = array( "rev_timestamp $oper " . $dbr->addQuotes( $dbr->timestamp( $offset ) ) );
240 $page_id = $this->page
->getId();
242 return $dbr->select( 'revision',
243 Revision
::selectFields(),
244 array_merge( array( 'rev_page' => $page_id ), $offsets ),
246 array( 'ORDER BY' => "rev_timestamp $dirs",
247 'USE INDEX' => 'page_timestamp', 'LIMIT' => $limit )
252 * Output a subscription feed listing recent edits to this page.
254 * @param string $type feed type
256 function feed( $type ) {
257 global $wgFeedClasses, $wgFeedLimit;
258 if ( !FeedUtils
::checkFeedOutput( $type ) ) {
261 $request = $this->getRequest();
263 /** @var RSSFeed|AtomFeed $feed */
264 $feed = new $wgFeedClasses[$type](
265 $this->getTitle()->getPrefixedText() . ' - ' .
266 $this->msg( 'history-feed-title' )->inContentLanguage()->text(),
267 $this->msg( 'history-feed-description' )->inContentLanguage()->text(),
268 $this->getTitle()->getFullURL( 'action=history' )
271 // Get a limit on number of feed entries. Provide a sane default
272 // of 10 if none is defined (but limit to $wgFeedLimit max)
273 $limit = $request->getInt( 'limit', 10 );
274 $limit = min( max( $limit, 1 ), $wgFeedLimit );
276 $items = $this->fetchRevisions( $limit, 0, HistoryPage
::DIR_NEXT
);
278 // Generate feed elements enclosed between header and footer.
280 if ( $items->numRows() ) {
281 foreach ( $items as $row ) {
282 $feed->outItem( $this->feedItem( $row ) );
285 $feed->outItem( $this->feedEmpty() );
290 function feedEmpty() {
292 $this->msg( 'nohistory' )->inContentLanguage()->text(),
293 $this->msg( 'history-feed-empty' )->inContentLanguage()->parseAsBlock(),
294 $this->getTitle()->getFullURL(),
295 wfTimestamp( TS_MW
),
297 $this->getTitle()->getTalkPage()->getFullURL()
302 * Generate a FeedItem object from a given revision table row
303 * Borrows Recent Changes' feed generation functions for formatting;
304 * includes a diff to the previous revision (if any).
306 * @param stdClass|array $row database row
309 function feedItem( $row ) {
310 $rev = new Revision( $row );
311 $rev->setTitle( $this->getTitle() );
312 $text = FeedUtils
::formatDiffRow(
314 $this->getTitle()->getPreviousRevisionID( $rev->getId() ),
316 $rev->getTimestamp(),
319 if ( $rev->getComment() == '' ) {
321 $title = $this->msg( 'history-feed-item-nocomment',
323 $wgContLang->timeanddate( $rev->getTimestamp() ),
324 $wgContLang->date( $rev->getTimestamp() ),
325 $wgContLang->time( $rev->getTimestamp() ) )->inContentLanguage()->text();
327 $title = $rev->getUserText() .
328 $this->msg( 'colon-separator' )->inContentLanguage()->text() .
329 FeedItem
::stripComment( $rev->getComment() );
335 $this->getTitle()->getFullURL( 'diff=' . $rev->getId() . '&oldid=prev' ),
336 $rev->getTimestamp(),
338 $this->getTitle()->getTalkPage()->getFullURL()
347 class HistoryPager
extends ReverseChronologicalPager
{
351 public $lastRow = false;
353 public $counter, $historyPage, $buttons, $conds;
355 protected $oldIdChecked;
357 protected $preventClickjacking = false;
361 protected $parentLens;
364 * @param HistoryAction $historyPage
365 * @param string $year
366 * @param string $month
367 * @param string $tagFilter
368 * @param array $conds
370 function __construct( $historyPage, $year = '', $month = '', $tagFilter = '', $conds = array() ) {
371 parent
::__construct( $historyPage->getContext() );
372 $this->historyPage
= $historyPage;
373 $this->tagFilter
= $tagFilter;
374 $this->getDateCond( $year, $month );
375 $this->conds
= $conds;
378 // For hook compatibility...
379 function getArticle() {
380 return $this->historyPage
->getArticle();
383 function getSqlComment() {
384 if ( $this->conds
) {
385 return 'history page filtered'; // potentially slow, see CR r58153
387 return 'history page unfiltered';
391 function getQueryInfo() {
393 'tables' => array( 'revision', 'user' ),
394 'fields' => array_merge( Revision
::selectFields(), Revision
::selectUserFields() ),
395 'conds' => array_merge(
396 array( 'rev_page' => $this->getWikiPage()->getId() ),
398 'options' => array( 'USE INDEX' => array( 'revision' => 'page_timestamp' ) ),
399 'join_conds' => array( 'user' => Revision
::userJoinCond() ),
401 ChangeTags
::modifyDisplayQuery(
402 $queryInfo['tables'],
403 $queryInfo['fields'],
405 $queryInfo['join_conds'],
406 $queryInfo['options'],
409 wfRunHooks( 'PageHistoryPager::getQueryInfo', array( &$this, &$queryInfo ) );
414 function getIndexField() {
415 return 'rev_timestamp';
419 * @param stdClass $row
422 function formatRow( $row ) {
423 if ( $this->lastRow
) {
424 $latest = ( $this->counter
== 1 && $this->mIsFirst
);
425 $firstInList = $this->counter
== 1;
427 $s = $this->historyLine( $this->lastRow
, $row,
428 $this->getTitle()->getNotificationTimestamp( $this->getUser() ), $latest, $firstInList );
432 $this->lastRow
= $row;
437 function doBatchLookups() {
438 # Do a link batch query
439 $this->mResult
->seek( 0 );
440 $batch = new LinkBatch();
442 foreach ( $this->mResult
as $row ) {
443 if ( $row->rev_parent_id
) {
444 $revIds[] = $row->rev_parent_id
;
446 if ( !is_null( $row->user_name
) ) {
447 $batch->add( NS_USER
, $row->user_name
);
448 $batch->add( NS_USER_TALK
, $row->user_name
);
449 } else { # for anons or usernames of imported revisions
450 $batch->add( NS_USER
, $row->rev_user_text
);
451 $batch->add( NS_USER_TALK
, $row->rev_user_text
);
454 $this->parentLens
= Revision
::getParentLengths( $this->mDb
, $revIds );
456 $this->mResult
->seek( 0 );
460 * Creates begin of history list with a submit button
462 * @return string HTML output
464 function getStartBody() {
466 $this->lastRow
= false;
468 $this->oldIdChecked
= 0;
470 $this->getOutput()->wrapWikiMsg( "<div class='mw-history-legend'>\n$1\n</div>", 'histlegend' );
471 $s = Html
::openElement( 'form', array( 'action' => $wgScript,
472 'id' => 'mw-history-compare' ) ) . "\n";
473 $s .= Html
::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . "\n";
474 $s .= Html
::hidden( 'action', 'historysubmit' ) . "\n";
476 // Button container stored in $this->buttons for re-use in getEndBody()
477 $this->buttons
= '<div>';
478 $this->buttons
.= $this->submitButton( $this->msg( 'compareselectedversions' )->text(),
479 array( 'class' => 'historysubmit mw-history-compareselectedversions-button' )
480 + Linker
::tooltipAndAccesskeyAttribs( 'compareselectedversions' )
483 if ( $this->getUser()->isAllowed( 'deleterevision' ) ) {
484 $this->buttons
.= $this->getRevisionButton( 'revisiondelete', 'showhideselectedversions' );
486 $this->buttons
.= '</div>';
488 $s .= $this->buttons
;
489 $s .= '<ul id="pagehistory">' . "\n";
494 private function getRevisionButton( $name, $msg ) {
495 $this->preventClickjacking();
496 # Note bug #20966, <button> is non-standard in IE<8
497 $element = Html
::element(
503 'class' => "historysubmit mw-history-$name-button",
505 $this->msg( $msg )->text()
510 function getEndBody() {
511 if ( $this->lastRow
) {
512 $latest = $this->counter
== 1 && $this->mIsFirst
;
513 $firstInList = $this->counter
== 1;
514 if ( $this->mIsBackwards
) {
515 # Next row is unknown, but for UI reasons, probably exists if an offset has been specified
516 if ( $this->mOffset
== '' ) {
522 # The next row is the past-the-end row
523 $next = $this->mPastTheEndRow
;
526 $s = $this->historyLine( $this->lastRow
, $next,
527 $this->getTitle()->getNotificationTimestamp( $this->getUser() ), $latest, $firstInList );
532 # Add second buttons only if there is more than one rev
533 if ( $this->getNumRows() > 2 ) {
534 $s .= $this->buttons
;
542 * Creates a submit button
544 * @param string $message Text of the submit button, will be escaped
545 * @param array $attributes Attributes
546 * @return string HTML output for the submit button
548 function submitButton( $message, $attributes = array() ) {
549 # Disable submit button if history has 1 revision only
550 if ( $this->getNumRows() > 1 ) {
551 return Xml
::submitButton( $message, $attributes );
558 * Returns a row from the history printout.
560 * @todo document some more, and maybe clean up the code (some params redundant?)
562 * @param stdClass $row The database row corresponding to the previous line.
563 * @param mixed $next The database row corresponding to the next line
564 * (chronologically previous)
565 * @param bool|string $notificationtimestamp
566 * @param bool $latest Whether this row corresponds to the page's latest revision.
567 * @param bool $firstInList Whether this row corresponds to the first
568 * displayed on this history page.
569 * @return string HTML output for the row
571 function historyLine( $row, $next, $notificationtimestamp = false,
572 $latest = false, $firstInList = false ) {
573 $rev = new Revision( $row );
574 $rev->setTitle( $this->getTitle() );
576 if ( is_object( $next ) ) {
577 $prevRev = new Revision( $next );
578 $prevRev->setTitle( $this->getTitle() );
583 $curlink = $this->curLink( $rev, $latest );
584 $lastlink = $this->lastLink( $rev, $next );
585 $curLastlinks = $curlink . $this->historyPage
->message
['pipe-separator'] . $lastlink;
586 $histLinks = Html
::rawElement(
588 array( 'class' => 'mw-history-histlinks' ),
589 $this->msg( 'parentheses' )->rawParams( $curLastlinks )->escaped()
592 $diffButtons = $this->diffButtons( $rev, $firstInList );
593 $s = $histLinks . $diffButtons;
595 $link = $this->revLink( $rev );
599 $user = $this->getUser();
600 // Show checkboxes for each revision
601 if ( $user->isAllowed( 'deleterevision' ) ) {
602 $this->preventClickjacking();
603 // If revision was hidden from sysops, disable the checkbox
604 if ( !$rev->userCan( Revision
::DELETED_RESTRICTED
, $user ) ) {
605 $del = Xml
::check( 'deleterevisions', false, array( 'disabled' => 'disabled' ) );
606 // Otherwise, enable the checkbox...
608 $del = Xml
::check( 'showhiderevisions', false,
609 array( 'name' => 'ids[' . $rev->getId() . ']' ) );
611 // User can only view deleted revisions...
612 } elseif ( $rev->getVisibility() && $user->isAllowed( 'deletedhistory' ) ) {
613 // If revision was hidden from sysops, disable the link
614 if ( !$rev->userCan( Revision
::DELETED_RESTRICTED
, $user ) ) {
615 $del = Linker
::revDeleteLinkDisabled( false );
616 // Otherwise, show the link...
618 $query = array( 'type' => 'revision',
619 'target' => $this->getTitle()->getPrefixedDBkey(), 'ids' => $rev->getId() );
620 $del .= Linker
::revDeleteLink( $query,
621 $rev->isDeleted( Revision
::DELETED_RESTRICTED
), false );
628 $lang = $this->getLanguage();
629 $dirmark = $lang->getDirMark();
633 $s .= " <span class='history-user'>" .
634 Linker
::revUserTools( $rev, true ) . "</span>";
637 if ( $rev->isMinor() ) {
638 $s .= ' ' . ChangesList
::flag( 'minor' );
641 # Sometimes rev_len isn't populated
642 if ( $rev->getSize() !== null ) {
643 # Size is always public data
644 $prevSize = isset( $this->parentLens
[$row->rev_parent_id
] )
645 ?
$this->parentLens
[$row->rev_parent_id
]
647 $sDiff = ChangesList
::showCharacterDifference( $prevSize, $rev->getSize() );
648 $fSize = Linker
::formatRevisionSize( $rev->getSize() );
649 $s .= ' <span class="mw-changeslist-separator">. .</span> ' . "$fSize $sDiff";
652 # Text following the character difference is added just before running hooks
653 $s2 = Linker
::revComment( $rev, false, true );
655 if ( $notificationtimestamp && ( $row->rev_timestamp
>= $notificationtimestamp ) ) {
656 $s2 .= ' <span class="updatedmarker">' . $this->msg( 'updatedmarker' )->escaped() . '</span>';
657 $classes[] = 'mw-history-line-updated';
662 # Rollback and undo links
663 if ( $prevRev && $this->getTitle()->quickUserCan( 'edit', $user ) ) {
664 if ( $latest && $this->getTitle()->quickUserCan( 'rollback', $user ) ) {
665 // Get a rollback link without the brackets
666 $rollbackLink = Linker
::generateRollback(
669 array( 'verify', 'noBrackets' )
671 if ( $rollbackLink ) {
672 $this->preventClickjacking();
673 $tools[] = $rollbackLink;
677 if ( !$rev->isDeleted( Revision
::DELETED_TEXT
)
678 && !$prevRev->isDeleted( Revision
::DELETED_TEXT
)
680 # Create undo tooltip for the first (=latest) line only
681 $undoTooltip = $latest
682 ?
array( 'title' => $this->msg( 'tooltip-undo' )->text() )
684 $undolink = Linker
::linkKnown(
686 $this->msg( 'editundo' )->escaped(),
690 'undoafter' => $prevRev->getId(),
691 'undo' => $rev->getId()
694 $tools[] = "<span class=\"mw-history-undo\">{$undolink}</span>";
697 // Allow extension to add their own links here
698 wfRunHooks( 'HistoryRevisionTools', array( $rev, &$tools ) );
701 $s2 .= ' ' . $this->msg( 'parentheses' )->rawParams( $lang->pipeList( $tools ) )->escaped();
705 list( $tagSummary, $newClasses ) = ChangeTags
::formatSummaryRow( $row->ts_tags
, 'history' );
706 $classes = array_merge( $classes, $newClasses );
707 if ( $tagSummary !== '' ) {
708 $s2 .= " $tagSummary";
711 # Include separator between character difference and following text
713 $s .= ' <span class="mw-changeslist-separator">. .</span> ' . $s2;
716 wfRunHooks( 'PageHistoryLineEnding', array( $this, &$row, &$s, &$classes ) );
720 $attribs['class'] = implode( ' ', $classes );
723 return Xml
::tags( 'li', $attribs, $s ) . "\n";
727 * Create a link to view this revision of the page
729 * @param Revision $rev
732 function revLink( $rev ) {
733 $date = $this->getLanguage()->userTimeAndDate( $rev->getTimestamp(), $this->getUser() );
734 $date = htmlspecialchars( $date );
735 if ( $rev->userCan( Revision
::DELETED_TEXT
, $this->getUser() ) ) {
736 $link = Linker
::linkKnown(
739 array( 'class' => 'mw-changeslist-date' ),
740 array( 'oldid' => $rev->getId() )
745 if ( $rev->isDeleted( Revision
::DELETED_TEXT
) ) {
746 $link = "<span class=\"history-deleted\">$link</span>";
753 * Create a diff-to-current link for this revision for this page
755 * @param Revision $rev
756 * @param bool $latest This is the latest revision of the page?
759 function curLink( $rev, $latest ) {
760 $cur = $this->historyPage
->message
['cur'];
761 if ( $latest ||
!$rev->userCan( Revision
::DELETED_TEXT
, $this->getUser() ) ) {
764 return Linker
::linkKnown(
769 'diff' => $this->getWikiPage()->getLatest(),
770 'oldid' => $rev->getId()
777 * Create a diff-to-previous link for this revision for this page.
779 * @param Revision $prevRev The previous revision
780 * @param mixed $next The newer revision
783 function lastLink( $prevRev, $next ) {
784 $last = $this->historyPage
->message
['last'];
785 # $next may either be a Row, null, or "unknown"
786 $nextRev = is_object( $next ) ?
new Revision( $next ) : $next;
787 if ( is_null( $next ) ) {
788 # Probably no next row
790 } elseif ( $next === 'unknown' ) {
791 # Next row probably exists but is unknown, use an oldid=prev link
792 return Linker
::linkKnown(
797 'diff' => $prevRev->getId(),
801 } elseif ( !$prevRev->userCan( Revision
::DELETED_TEXT
, $this->getUser() )
802 ||
!$nextRev->userCan( Revision
::DELETED_TEXT
, $this->getUser() )
806 return Linker
::linkKnown(
811 'diff' => $prevRev->getId(),
812 'oldid' => $next->rev_id
819 * Create radio buttons for page history
821 * @param Revision $rev
822 * @param bool $firstInList Is this version the first one?
824 * @return string HTML output for the radio buttons
826 function diffButtons( $rev, $firstInList ) {
827 if ( $this->getNumRows() > 1 ) {
829 $radio = array( 'type' => 'radio', 'value' => $id );
830 /** @todo Move title texts to javascript */
831 if ( $firstInList ) {
832 $first = Xml
::element( 'input',
833 array_merge( $radio, array(
834 'style' => 'visibility:hidden',
836 'id' => 'mw-oldid-null' ) )
838 $checkmark = array( 'checked' => 'checked' );
840 # Check visibility of old revisions
841 if ( !$rev->userCan( Revision
::DELETED_TEXT
, $this->getUser() ) ) {
842 $radio['disabled'] = 'disabled';
843 $checkmark = array(); // We will check the next possible one
844 } elseif ( !$this->oldIdChecked
) {
845 $checkmark = array( 'checked' => 'checked' );
846 $this->oldIdChecked
= $id;
848 $checkmark = array();
850 $first = Xml
::element( 'input',
851 array_merge( $radio, $checkmark, array(
853 'id' => "mw-oldid-$id" ) ) );
854 $checkmark = array();
856 $second = Xml
::element( 'input',
857 array_merge( $radio, $checkmark, array(
859 'id' => "mw-diff-$id" ) ) );
861 return $first . $second;
868 * This is called if a write operation is possible from the generated HTML
870 function preventClickjacking( $enable = true ) {
871 $this->preventClickjacking
= $enable;
875 * Get the "prevent clickjacking" flag
878 function getPreventClickjacking() {
879 return $this->preventClickjacking
;
884 * Backwards-compatibility alias
886 class HistoryPage
extends HistoryAction
{
887 // @codingStandardsIgnoreStart Needed "useless" override to make it public.
888 public function __construct( Page
$article ) {
889 parent
::__construct( $article );
891 // @codingStandardsIgnoreEnd
893 public function history() {