History should still look right when focusing on an old revision
authorAaron Schulz <aaron@users.mediawiki.org>
Sun, 3 Feb 2008 08:43:58 +0000 (08:43 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sun, 3 Feb 2008 08:43:58 +0000 (08:43 +0000)
includes/ImagePage.php

index 84beb56..e73730b 100644 (file)
@@ -24,6 +24,9 @@ class ImagePage extends Article {
                $this->img = wfFindFile( $this->mTitle, $time );
                if ( !$this->img ) {
                        $this->img = wfLocalFile( $this->mTitle );
+                       $this->current = $this->img;
+               } else {
+                       $this->current = $time ? wfLocalFile( $this->mTitle ) : $this->img;
                }
                $this->repo = $this->img->repo;
        }
@@ -412,8 +415,8 @@ EOT
                $sk = $wgUser->getSkin();
 
                if ( $this->img->exists() ) {
-                       $list = new ImageHistoryList( $sk, $this->img );
-                       $file = $this->img;
+                       $list = new ImageHistoryList( $sk, $this->current );
+                       $file = $this->current;
                        $dims = $file->getDimensionsString();
                        $s = $list->beginImageHistoryList() .
                                $list->imageHistoryLine( true, wfTimestamp(TS_MW, $file->getTimestamp()),