Merge "Added ORMIterator interface which can be used for type hinting (in particular...
[lhc/web/wiklou.git] / includes / actions / HistoryAction.php
index 8e6bcd9..50d210f 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 ) {