Rename WikiPage::isParserCacheUsed to WikiPage::shouldCheckParserCache
[lhc/web/wiklou.git] / includes / page / ImagePage.php
index 8f635cf..7ea4ed7 100644 (file)
@@ -614,8 +614,8 @@ EOT
                        $out->wrapWikiMsg( "<div id='mw-imagepage-nofile' class='plainlinks'>\n$1\n</div>", $nofile );
                        if ( !$this->getID() && $wgSend404Code ) {
                                // If there is no image, no shared image, and no description page,
-                               // output a 404, to be consistent with articles.
-                               $request->response()->header( 'HTTP/1.1 404 Not Found' );
+                               // output a 404, to be consistent with Article::showMissingArticle.
+                               $request->response()->statusHeader( 404 );
                        }
                }
                $out->setFileVersion( $this->displayImg );
@@ -1515,6 +1515,18 @@ class ImageHistoryPseudoPager extends ReverseChronologicalPager {
                $s = '';
                $this->doQuery();
                if ( count( $this->mHist ) ) {
+                       if ( $this->mImg->isLocal() ) {
+                               // Do a batch existence check for user pages and talkpages
+                               $linkBatch = new LinkBatch();
+                               for ( $i = $this->mRange[0]; $i <= $this->mRange[1]; $i++ ) {
+                                       $file = $this->mHist[$i];
+                                       $user = $file->getUser( 'text' );
+                                       $linkBatch->add( NS_USER, $user );
+                                       $linkBatch->add( NS_USER_TALK, $user );
+                               }
+                               $linkBatch->execute();
+                       }
+
                        $list = new ImageHistoryList( $this->mImagePage );
                        # Generate prev/next links
                        $navLink = $this->getNavigationBar();