Merge "Use Linker::getInvalidTitleDescription() to display invalid title entries...
[lhc/web/wiklou.git] / includes / actions / HistoryAction.php
index 8e6bcd9..6f48cd0 100644 (file)
@@ -87,7 +87,7 @@ class HistoryAction extends FormlessAction {
         * Print the history page for an article.
         */
        function onView() {
-               global $wgScript, $wgUseFileCache, $wgSquidMaxage;
+               global $wgScript, $wgUseFileCache;
 
                $out = $this->getOutput();
                $request = $this->getRequest();
@@ -101,10 +101,6 @@ class HistoryAction extends FormlessAction {
 
                wfProfileIn( __METHOD__ );
 
-               if ( $request->getFullRequestURL() == $this->getTitle()->getInternalURL( 'action=history' ) ) {
-                       $out->setSquidMaxage( $wgSquidMaxage );
-               }
-
                $this->preCacheMessages();
 
                # Fill in the file cache if not set already
@@ -208,6 +204,11 @@ class HistoryAction extends FormlessAction {
         * @return ResultWrapper
         */
        function fetchRevisions( $limit, $offset, $direction ) {
+               // Fail if article doesn't exist.
+               if( !$this->getTitle()->exists() ) {
+                       return new FakeResultWrapper( array() );
+               }
+
                $dbr = wfGetDB( DB_SLAVE );
 
                if ( $direction == HistoryPage::DIR_PREV ) {
@@ -634,6 +635,7 @@ class HistoryPager extends ReverseChronologicalPager {
 
                if ( $notificationtimestamp && ( $row->rev_timestamp >= $notificationtimestamp ) ) {
                        $s2 .= ' <span class="updatedmarker">' .  $this->msg( 'updatedmarker' )->escaped() . '</span>';
+                       $classes[] = 'mw-history-line-updated';
                }
 
                $tools = array();
@@ -645,7 +647,7 @@ class HistoryPager extends ReverseChronologicalPager {
                        if ( $latest && !count( $this->getTitle()->getUserPermissionsErrors( 'rollback', $this->getUser() ) ) ) {
                                $this->preventClickjacking();
                                $tools[] = '<span class="mw-rollback-link">' .
-                                       Linker::buildRollbackLink( $rev ) . '</span>';
+                                       Linker::buildRollbackLink( $rev, $this->getContext() ) . '</span>';
                        }
 
                        if ( !$rev->isDeleted( Revision::DELETED_TEXT )