Index: trunk/phase3/includes/ImagePage.php |
— | — | @@ -22,6 +22,12 @@ |
23 | 23 | $this->dupes = null; |
24 | 24 | $this->repo = null; |
25 | 25 | } |
| 26 | + |
| 27 | + public function setFile( $file ) { |
| 28 | + $this->displayImg = $file; |
| 29 | + $this->img = $file; |
| 30 | + $this->fileLoaded = true; |
| 31 | + } |
26 | 32 | |
27 | 33 | protected function loadFile() { |
28 | 34 | if( $this->fileLoaded ) { |
Index: trunk/phase3/includes/filerepo/LocalFile.php |
— | — | @@ -890,6 +890,7 @@ |
891 | 891 | |
892 | 892 | $descTitle = $this->getTitle(); |
893 | 893 | $article = new ImagePage( $descTitle ); |
| 894 | + $article->setFile( $this ); |
894 | 895 | |
895 | 896 | # Add the log entry |
896 | 897 | $log = new LogPage( 'upload' ); |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -1053,10 +1053,13 @@ |
1054 | 1054 | |
1055 | 1055 | # If this is an image page, store corresponding file info |
1056 | 1056 | $fileData = array(); |
1057 | | - if( $title->getNamespace() == NS_FILE && ($file = wfFindFile($title)) ) { |
1058 | | - $fileData['name'] = $title->getDBkey(); |
1059 | | - $fileData['timestamp'] = $file->getTimestamp(); |
1060 | | - $fileData['sha1'] = $file->getSha1(); |
| 1057 | + if( $title->getNamespace() == NS_FILE ) { |
| 1058 | + $file = $article instanceof ImagePage ? $article->getFile() : wfFindFile($title); |
| 1059 | + if( is_object($file) && $file->exists() ) { |
| 1060 | + $fileData['name'] = $title->getDBkey(); |
| 1061 | + $fileData['timestamp'] = $file->getTimestamp(); |
| 1062 | + $fileData['sha1'] = $file->getSha1(); |
| 1063 | + } |
1061 | 1064 | } |
1062 | 1065 | |
1063 | 1066 | # Our review entry |