Escaping fixes
[lhc/web/wiklou.git] / includes / PageHistory.php
1 <?php
2 /**
3 * Page history
4 *
5 * Split off from Article.php and Skin.php, 2003-12-22
6 * @file
7 */
8
9 /**
10 * This class handles printing the history page for an article. In order to
11 * be efficient, it uses timestamps rather than offsets for paging, to avoid
12 * costly LIMIT,offset queries.
13 *
14 * Construct it by passing in an Article, and call $h->history() to print the
15 * history.
16 *
17 */
18 class PageHistory {
19 const DIR_PREV = 0;
20 const DIR_NEXT = 1;
21
22 var $mArticle, $mTitle, $mSkin;
23 var $lastdate;
24 var $linesonpage;
25 var $mLatestId = null;
26
27 private $mOldIdChecked = 0;
28
29 /**
30 * Construct a new PageHistory.
31 *
32 * @param Article $article
33 * @returns nothing
34 */
35 function __construct( $article ) {
36 global $wgUser;
37 $this->mArticle =& $article;
38 $this->mTitle =& $article->mTitle;
39 $this->mSkin = $wgUser->getSkin();
40 $this->preCacheMessages();
41 }
42
43 function getArticle() {
44 return $this->mArticle;
45 }
46
47 function getTitle() {
48 return $this->mTitle;
49 }
50
51 /**
52 * As we use the same small set of messages in various methods and that
53 * they are called often, we call them once and save them in $this->message
54 */
55 function preCacheMessages() {
56 // Precache various messages
57 if( !isset( $this->message ) ) {
58 foreach( explode(' ', 'cur last rev-delundel' ) as $msg ) {
59 $this->message[$msg] = wfMsgExt( $msg, array( 'escape') );
60 }
61 }
62 }
63
64 /**
65 * Print the history page for an article.
66 *
67 * @returns nothing
68 */
69 function history() {
70 global $wgOut, $wgRequest, $wgScript;
71
72 /*
73 * Allow client caching.
74 */
75 if( $wgOut->checkLastModified( $this->mArticle->getTouched() ) )
76 return; // Client cache fresh and headers sent, nothing more to do.
77
78 wfProfileIn( __METHOD__ );
79
80 /*
81 * Setup page variables.
82 */
83 $wgOut->setPageTitle( wfMsg( 'history-title', $this->mTitle->getPrefixedText() ) );
84 $wgOut->setPageTitleActionText( wfMsg( 'history_short' ) );
85 $wgOut->setArticleFlag( false );
86 $wgOut->setArticleRelated( true );
87 $wgOut->setRobotPolicy( 'noindex,nofollow' );
88 $wgOut->setSyndicated( true );
89 $wgOut->setFeedAppendQuery( 'action=history' );
90 $wgOut->addScriptFile( 'history.js' );
91
92 $logPage = SpecialPage::getTitleFor( 'Log' );
93 $logLink = $this->mSkin->makeKnownLinkObj( $logPage, wfMsgHtml( 'viewpagelogs' ),
94 'page=' . $this->mTitle->getPrefixedUrl() );
95 $wgOut->setSubtitle( $logLink );
96
97 $feedType = $wgRequest->getVal( 'feed' );
98 if( $feedType ) {
99 wfProfileOut( __METHOD__ );
100 return $this->feed( $feedType );
101 }
102
103 /*
104 * Fail if article doesn't exist.
105 */
106 if( !$this->mTitle->exists() ) {
107 $wgOut->addWikiMsg( 'nohistory' );
108 wfProfileOut( __METHOD__ );
109 return;
110 }
111
112 /**
113 * Add date selector to quickly get to a certain time
114 */
115 $year = $wgRequest->getInt( 'year' );
116 $month = $wgRequest->getInt( 'month' );
117 $tagFilter = $wgRequest->getVal( 'tagfilter' );
118 $tagSelector = ChangeTags::buildTagFilterSelector( $tagFilter );
119
120 $action = htmlspecialchars( $wgScript );
121 $wgOut->addHTML(
122 "<form action=\"$action\" method=\"get\" id=\"mw-history-searchform\">" .
123 Xml::fieldset( wfMsg( 'history-fieldset-title' ), false, array( 'id' => 'mw-history-search' ) ) .
124 Xml::hidden( 'title', $this->mTitle->getPrefixedDBKey() ) . "\n" .
125 Xml::hidden( 'action', 'history' ) . "\n" .
126 xml::dateMenu( $year, $month ) . '&nbsp;' .
127 ( $tagSelector ? ( implode( '&nbsp;', $tagSelector ) . '&nbsp;' ) : '' ) .
128 Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" .
129 '</fieldset></form>'
130 );
131
132 wfRunHooks( 'PageHistoryBeforeList', array( &$this->mArticle ) );
133
134 /**
135 * Do the list
136 */
137 $pager = new PageHistoryPager( $this, $year, $month, $tagFilter );
138 $this->linesonpage = $pager->getNumRows();
139 $wgOut->addHTML(
140 $pager->getNavigationBar() .
141 $this->beginHistoryList() .
142 $pager->getBody() .
143 $this->endHistoryList() .
144 $pager->getNavigationBar()
145 );
146
147 wfProfileOut( __METHOD__ );
148 }
149
150 /**
151 * Creates begin of history list with a submit button
152 *
153 * @return string HTML output
154 */
155 function beginHistoryList() {
156 global $wgUser, $wgScript, $wgEnableHtmlDiff;
157 $this->lastdate = '';
158 $s = wfMsgExt( 'histlegend', array( 'parse') );
159 if( $this->linesonpage > 1 && $wgUser->isAllowed('deleterevision') ) {
160 $revdel = SpecialPage::getTitleFor( 'Revisiondelete' );
161 $s .= Xml::openElement( 'form',
162 array(
163 'action' => $revdel->getFullUrl(),
164 'method' => 'get', 'id' => 'mw-history-revdeleteform',
165 'style' => 'visibility:hidden;float:right;'
166 )
167 );
168 $s .= Xml::hidden( 'target', $this->mTitle->getPrefixedDbKey() );
169 $s .= Xml::hidden( 'oldid', '', array('id'=>'revdel-oldid') );
170 $s .= Xml::submitButton( wfMsg( 'showhideselectedversions' ) );
171 $s .= Xml::closeElement( 'form' );
172 }
173 $s .= Xml::openElement( 'form', array( 'action' => $wgScript,
174 'id' => 'mw-history-compare' ) );
175 $s .= Xml::hidden( 'title', $this->mTitle->getPrefixedDbKey() );
176 if( $wgEnableHtmlDiff ) {
177 $s .= $this->submitButton( wfMsg( 'visualcomparison'),
178 array(
179 'name' => 'htmldiff',
180 'class' => 'historysubmit',
181 'accesskey' => wfMsg( 'accesskey-visualcomparison' ),
182 'title' => wfMsg( 'tooltip-compareselectedversions' ),
183 )
184 );
185 $s .= $this->submitButton( wfMsg( 'wikicodecomparison'),
186 array(
187 'class' => 'historysubmit',
188 'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
189 'title' => wfMsg( 'tooltip-compareselectedversions' ),
190 )
191 );
192 } else {
193 $s .= $this->submitButton( wfMsg( 'compareselectedversions'),
194 array(
195 'class' => 'historysubmit',
196 'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
197 'title' => wfMsg( 'tooltip-compareselectedversions' ),
198 )
199 );
200 }
201 $s .= '<ul id="pagehistory">' . "\n";
202 return $s;
203 }
204
205 /**
206 * Creates end of history list with a submit button
207 *
208 * @return string HTML output
209 */
210 function endHistoryList() {
211 global $wgEnableHtmlDiff;
212 $s = '</ul>';
213 if( $wgEnableHtmlDiff ) {
214 $s .= $this->submitButton( wfMsg( 'visualcomparison'),
215 array(
216 'name' => 'htmldiff',
217 'class' => 'historysubmit',
218 'accesskey' => wfMsg( 'accesskey-visualcomparison' ),
219 'title' => wfMsg( 'tooltip-compareselectedversions' ),
220 )
221 );
222 $s .= $this->submitButton( wfMsg( 'wikicodecomparison'),
223 array(
224 'class' => 'historysubmit',
225 'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
226 'title' => wfMsg( 'tooltip-compareselectedversions' ),
227 )
228 );
229 } else {
230 $s .= $this->submitButton( wfMsg( 'compareselectedversions'),
231 array(
232 'class' => 'historysubmit',
233 'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
234 'title' => wfMsg( 'tooltip-compareselectedversions' ),
235 )
236 );
237 }
238 $s .= '</form>';
239 return $s;
240 }
241
242 /**
243 * Creates a submit button
244 *
245 * @param array $attributes attributes
246 * @return string HTML output for the submit button
247 */
248 function submitButton($message, $attributes = array() ) {
249 # Disable submit button if history has 1 revision only
250 if( $this->linesonpage > 1 ) {
251 return Xml::submitButton( $message , $attributes );
252 } else {
253 return '';
254 }
255 }
256
257 /**
258 * Returns a row from the history printout.
259 *
260 * @todo document some more, and maybe clean up the code (some params redundant?)
261 *
262 * @param Row $row The database row corresponding to the previous line.
263 * @param mixed $next The database row corresponding to the next line.
264 * @param int $counter Apparently a counter of what row number we're at, counted from the top row = 1.
265 * @param $notificationtimestamp
266 * @param bool $latest Whether this row corresponds to the page's latest revision.
267 * @param bool $firstInList Whether this row corresponds to the first displayed on this history page.
268 * @return string HTML output for the row
269 */
270 function historyLine( $row, $next, $counter = '', $notificationtimestamp = false,
271 $latest = false, $firstInList = false )
272 {
273 global $wgUser, $wgLang;
274 $rev = new Revision( $row );
275 $rev->setTitle( $this->mTitle );
276
277 $curlink = $this->curLink( $rev, $latest );
278 $lastlink = $this->lastLink( $rev, $next, $counter );
279 $arbitrary = $this->diffButtons( $rev, $firstInList, $counter );
280 $link = $this->revLink( $rev );
281 $classes = array();
282
283 $s = "($curlink) ($lastlink) $arbitrary";
284
285 if( $wgUser->isAllowed( 'deleterevision' ) ) {
286 // Hide JS by default for non-JS browsing
287 $hidden = array( 'style' => 'display:none' );
288 // If revision was hidden from sysops
289 if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) {
290 $del = Xml::check( 'deleterevisions', false,
291 $hidden + array('disabled' => 'disabled') );
292 $del .= Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ),
293 '(' . $this->message['rev-delundel'] . ')' );
294 // Otherwise, show the link...
295 } else {
296 $jsCall = 'updateShowHideForm('.$rev->getId().',this.checked)';
297 $del = Xml::check( 'showhiderevisions', false,
298 $hidden + array('onchange' => $jsCall) );
299 $query = array( 'target' => $this->mTitle->getPrefixedDbkey(),
300 'oldid' => $rev->getId() );
301 $del .= $this->mSkin->revDeleteLink( $query,
302 $rev->isDeleted( Revision::DELETED_RESTRICTED ) );
303 }
304 $s .= " $del ";
305 }
306
307 $s .= " $link";
308 $s .= " <span class='history-user'>" . $this->mSkin->revUserTools( $rev, true ) . "</span>";
309
310 if( $rev->isMinor() ) {
311 $s .= ' ' . Xml::element( 'span', array( 'class' => 'minor' ), wfMsg( 'minoreditletter') );
312 }
313
314 if( !is_null( $size = $rev->getSize() ) && !$rev->isDeleted( Revision::DELETED_TEXT ) ) {
315 $s .= ' ' . $this->mSkin->formatRevisionSize( $size );
316 }
317
318 $s .= $this->mSkin->revComment( $rev, false, true );
319
320 if( $notificationtimestamp && ($row->rev_timestamp >= $notificationtimestamp) ) {
321 $s .= ' <span class="updatedmarker">' . wfMsgHtml( 'updatedmarker' ) . '</span>';
322 }
323 if( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
324 $s .= ' <tt>' . wfMsgHtml( 'deletedrev' ) . '</tt>';
325 }
326
327 $tools = array();
328
329 if( !is_null( $next ) && is_object( $next ) ) {
330 if( $latest && $this->mTitle->userCan( 'rollback' ) && $this->mTitle->userCan( 'edit' ) ) {
331 $tools[] = '<span class="mw-rollback-link">'.$this->mSkin->buildRollbackLink( $rev ).'</span>';
332 }
333
334 if( $this->mTitle->quickUserCan( 'edit' ) && !$rev->isDeleted( Revision::DELETED_TEXT ) &&
335 !$next->rev_deleted & Revision::DELETED_TEXT )
336 {
337 # Create undo tooltip for the first (=latest) line only
338 $undoTooltip = $latest
339 ? array( 'title' => wfMsg( 'tooltip-undo' ) )
340 : array();
341 $undolink = $this->mSkin->link(
342 $this->mTitle,
343 wfMsgHtml( 'editundo' ),
344 $undoTooltip,
345 array( 'action' => 'edit', 'undoafter' => $next->rev_id, 'undo' => $rev->getId() ),
346 array( 'known', 'noclasses' )
347 );
348 $tools[] = "<span class=\"mw-history-undo\">{$undolink}</span>";
349 }
350 }
351
352 if( $tools ) {
353 $s .= ' (' . $wgLang->pipeList( $tools ) . ')';
354 }
355
356 # Tags
357 list($tagSummary, $newClasses) = ChangeTags::formatSummaryRow( $row->ts_tags, 'history' );
358 $classes = array_merge( $classes, $newClasses );
359 $s .= " $tagSummary";
360
361 wfRunHooks( 'PageHistoryLineEnding', array( $this, &$row , &$s ) );
362
363 $classes = implode( ' ', $classes );
364
365 return "<li class=\"$classes\">$s</li>\n";
366 }
367
368 /**
369 * Create a link to view this revision of the page
370 * @param Revision $rev
371 * @returns string
372 */
373 function revLink( $rev ) {
374 global $wgLang;
375 $date = $wgLang->timeanddate( wfTimestamp(TS_MW, $rev->getTimestamp()), true );
376 $date = htmlspecialchars( $date );
377 if( !$rev->isDeleted( Revision::DELETED_TEXT ) ) {
378 $link = $this->mSkin->makeKnownLinkObj( $this->mTitle, $date, "oldid=" . $rev->getId() );
379 } else {
380 $link = "<span class=\"history-deleted\">$date</span>";
381 }
382 return $link;
383 }
384
385 /**
386 * Create a diff-to-current link for this revision for this page
387 * @param Revision $rev
388 * @param Bool $latest, this is the latest revision of the page?
389 * @returns string
390 */
391 function curLink( $rev, $latest ) {
392 $cur = $this->message['cur'];
393 if( $latest || !$rev->userCan( Revision::DELETED_TEXT ) ) {
394 return $cur;
395 } else {
396 return $this->mSkin->makeKnownLinkObj( $this->mTitle, $cur,
397 'diff=' . $this->mTitle->getLatestRevID() . "&oldid=" . $rev->getId() );
398 }
399 }
400
401 /**
402 * Create a diff-to-previous link for this revision for this page.
403 * @param Revision $prevRev, the previous revision
404 * @param mixed $next, the newer revision
405 * @param int $counter, what row on the history list this is
406 * @returns string
407 */
408 function lastLink( $prevRev, $next, $counter ) {
409 $last = $this->message['last'];
410 # $next may either be a Row, null, or "unkown"
411 $nextRev = is_object($next) ? new Revision( $next ) : $next;
412 if( is_null($next) ) {
413 # Probably no next row
414 return $last;
415 } elseif( $next === 'unknown' ) {
416 # Next row probably exists but is unknown, use an oldid=prev link
417 return $this->mSkin->makeKnownLinkObj( $this->mTitle, $last,
418 "diff=" . $prevRev->getId() . "&oldid=prev" );
419 } elseif( !$prevRev->userCan(Revision::DELETED_TEXT) || !$nextRev->userCan(Revision::DELETED_TEXT) ) {
420 return $last;
421 } else {
422 return $this->mSkin->makeKnownLinkObj( $this->mTitle, $last,
423 "diff=" . $prevRev->getId() . "&oldid={$next->rev_id}" );
424 }
425 }
426
427 /**
428 * Create radio buttons for page history
429 *
430 * @param object $rev Revision
431 * @param bool $firstInList Is this version the first one?
432 * @param int $counter A counter of what row number we're at, counted from the top row = 1.
433 * @return string HTML output for the radio buttons
434 */
435 function diffButtons( $rev, $firstInList, $counter ) {
436 if( $this->linesonpage > 1 ) {
437 $radio = array( 'type' => 'radio', 'value' => $rev->getId() );
438 /** @todo: move title texts to javascript */
439 if( $firstInList ) {
440 $first = Xml::element( 'input',
441 array_merge( $radio, array( 'style' => 'visibility:hidden', 'name' => 'oldid' ) )
442 );
443 $checkmark = array( 'checked' => 'checked' );
444 } else {
445 # Check visibility of old revisions
446 if( !$rev->userCan( Revision::DELETED_TEXT ) ) {
447 $radio['disabled'] = 'disabled';
448 $checkmark = array(); // We will check the next possible one
449 } else if( $counter == 2 || !$this->mOldIdChecked ) {
450 $checkmark = array( 'checked' => 'checked' );
451 $this->mOldIdChecked = $rev->getId();
452 } else {
453 $checkmark = array();
454 }
455 $first = Xml::element( 'input', array_merge( $radio, $checkmark, array( 'name' => 'oldid' ) ) );
456 $checkmark = array();
457 }
458 $second = Xml::element( 'input', array_merge( $radio, $checkmark, array( 'name' => 'diff' ) ) );
459 return $first . $second;
460 } else {
461 return '';
462 }
463 }
464
465 /**
466 * Fetch an array of revisions, specified by a given limit, offset and
467 * direction. This is now only used by the feeds. It was previously
468 * used by the main UI but that's now handled by the pager.
469 */
470 function fetchRevisions($limit, $offset, $direction) {
471 $dbr = wfGetDB( DB_SLAVE );
472
473 if( $direction == PageHistory::DIR_PREV )
474 list($dirs, $oper) = array("ASC", ">=");
475 else /* $direction == PageHistory::DIR_NEXT */
476 list($dirs, $oper) = array("DESC", "<=");
477
478 if( $offset )
479 $offsets = array("rev_timestamp $oper '$offset'");
480 else
481 $offsets = array();
482
483 $page_id = $this->mTitle->getArticleID();
484
485 return $dbr->select( 'revision',
486 Revision::selectFields(),
487 array_merge(array("rev_page=$page_id"), $offsets),
488 __METHOD__,
489 array( 'ORDER BY' => "rev_timestamp $dirs",
490 'USE INDEX' => 'page_timestamp', 'LIMIT' => $limit)
491 );
492 }
493
494 /**
495 * Output a subscription feed listing recent edits to this page.
496 * @param string $type
497 */
498 function feed( $type ) {
499 global $wgFeedClasses, $wgRequest, $wgFeedLimit;
500 if( !FeedUtils::checkFeedOutput($type) ) {
501 return;
502 }
503
504 $feed = new $wgFeedClasses[$type](
505 $this->mTitle->getPrefixedText() . ' - ' .
506 wfMsgForContent( 'history-feed-title' ),
507 wfMsgForContent( 'history-feed-description' ),
508 $this->mTitle->getFullUrl( 'action=history' ) );
509
510 // Get a limit on number of feed entries. Provide a sane default
511 // of 10 if none is defined (but limit to $wgFeedLimit max)
512 $limit = $wgRequest->getInt( 'limit', 10 );
513 if( $limit > $wgFeedLimit || $limit < 1 ) {
514 $limit = 10;
515 }
516 $items = $this->fetchRevisions($limit, 0, PageHistory::DIR_NEXT);
517
518 $feed->outHeader();
519 if( $items ) {
520 foreach( $items as $row ) {
521 $feed->outItem( $this->feedItem( $row ) );
522 }
523 } else {
524 $feed->outItem( $this->feedEmpty() );
525 }
526 $feed->outFooter();
527 }
528
529 function feedEmpty() {
530 global $wgOut;
531 return new FeedItem(
532 wfMsgForContent( 'nohistory' ),
533 $wgOut->parse( wfMsgForContent( 'history-feed-empty' ) ),
534 $this->mTitle->getFullUrl(),
535 wfTimestamp( TS_MW ),
536 '',
537 $this->mTitle->getTalkPage()->getFullUrl() );
538 }
539
540 /**
541 * Generate a FeedItem object from a given revision table row
542 * Borrows Recent Changes' feed generation functions for formatting;
543 * includes a diff to the previous revision (if any).
544 *
545 * @param $row
546 * @return FeedItem
547 */
548 function feedItem( $row ) {
549 $rev = new Revision( $row );
550 $rev->setTitle( $this->mTitle );
551 $text = FeedUtils::formatDiffRow( $this->mTitle,
552 $this->mTitle->getPreviousRevisionID( $rev->getId() ),
553 $rev->getId(),
554 $rev->getTimestamp(),
555 $rev->getComment() );
556
557 if( $rev->getComment() == '' ) {
558 global $wgContLang;
559 $title = wfMsgForContent( 'history-feed-item-nocomment',
560 $rev->getUserText(),
561 $wgContLang->timeanddate( $rev->getTimestamp() ) );
562 } else {
563 $title = $rev->getUserText() . wfMsgForContent( 'colon-separator' ) . FeedItem::stripComment( $rev->getComment() );
564 }
565
566 return new FeedItem(
567 $title,
568 $text,
569 $this->mTitle->getFullUrl( 'diff=' . $rev->getId() . '&oldid=prev' ),
570 $rev->getTimestamp(),
571 $rev->getUserText(),
572 $this->mTitle->getTalkPage()->getFullUrl() );
573 }
574 }
575
576
577 /**
578 * @ingroup Pager
579 */
580 class PageHistoryPager extends ReverseChronologicalPager {
581 public $mLastRow = false, $mPageHistory, $mTitle;
582
583 function __construct( $pageHistory, $year='', $month='', $tagFilter = '' ) {
584 parent::__construct();
585 $this->mPageHistory = $pageHistory;
586 $this->mTitle =& $this->mPageHistory->mTitle;
587 $this->tagFilter = $tagFilter;
588 $this->getDateCond( $year, $month );
589 }
590
591 function getQueryInfo() {
592 $queryInfo = array(
593 'tables' => array('revision'),
594 'fields' => array_merge( Revision::selectFields(), array('ts_tags') ),
595 'conds' => array('rev_page' => $this->mPageHistory->mTitle->getArticleID() ),
596 'options' => array( 'USE INDEX' => array('revision' => 'page_timestamp') ),
597 'join_conds' => array( 'tag_summary' => array( 'LEFT JOIN', 'ts_rev_id=rev_id' ) ),
598 );
599 ChangeTags::modifyDisplayQuery( $queryInfo['tables'],
600 $queryInfo['fields'],
601 $queryInfo['conds'],
602 $queryInfo['join_conds'],
603 $queryInfo['options'],
604 $this->tagFilter );
605 wfRunHooks( 'PageHistoryPager::getQueryInfo', array( &$this, &$queryInfo ) );
606 return $queryInfo;
607 }
608
609 function getIndexField() {
610 return 'rev_timestamp';
611 }
612
613 function formatRow( $row ) {
614 if( $this->mLastRow ) {
615 $latest = $this->mCounter == 1 && $this->mIsFirst;
616 $firstInList = $this->mCounter == 1;
617 $s = $this->mPageHistory->historyLine( $this->mLastRow, $row, $this->mCounter++,
618 $this->mTitle->getNotificationTimestamp(), $latest, $firstInList );
619 } else {
620 $s = '';
621 }
622 $this->mLastRow = $row;
623 return $s;
624 }
625
626 function getStartBody() {
627 $this->mLastRow = false;
628 $this->mCounter = 1;
629 return '';
630 }
631
632 function getEndBody() {
633 if( $this->mLastRow ) {
634 $latest = $this->mCounter == 1 && $this->mIsFirst;
635 $firstInList = $this->mCounter == 1;
636 if( $this->mIsBackwards ) {
637 # Next row is unknown, but for UI reasons, probably exists if an offset has been specified
638 if( $this->mOffset == '' ) {
639 $next = null;
640 } else {
641 $next = 'unknown';
642 }
643 } else {
644 # The next row is the past-the-end row
645 $next = $this->mPastTheEndRow;
646 }
647 $s = $this->mPageHistory->historyLine( $this->mLastRow, $next, $this->mCounter++,
648 $this->mTitle->getNotificationTimestamp(), $latest, $firstInList );
649 } else {
650 $s = '';
651 }
652 return $s;
653 }
654 }