Index: trunk/phase3/includes/filerepo/File.php |
— | — | @@ -1122,23 +1122,8 @@ |
1123 | 1123 | |
1124 | 1124 | /** |
1125 | 1125 | * Get the HTML text of the description page, if available |
1126 | | - * For local files ImagePage does not use it, because it skips the parser cache. |
1127 | 1126 | */ |
1128 | 1127 | function getDescriptionText() { |
1129 | | - if( $this->isLocal() ) { |
1130 | | - global $wgParser; |
1131 | | - $revision = Revision::newFromTitle( $this->title ); |
1132 | | - if ( !$revision ) { |
1133 | | - return false; |
1134 | | - } |
1135 | | - $text = $revision->getText(); |
1136 | | - if ( !$text ) { |
1137 | | - return false; |
1138 | | - } |
1139 | | - $pout = $wgParser->parse( $text, $this->title, new ParserOptions() ); |
1140 | | - return $pout->getText(); |
1141 | | - } |
1142 | | - |
1143 | 1128 | global $wgMemc, $wgLang; |
1144 | 1129 | if ( !$this->repo->fetchDescription ) { |
1145 | 1130 | return false; |
Index: trunk/phase3/includes/filerepo/LocalFile.php |
— | — | @@ -1217,9 +1217,28 @@ |
1218 | 1218 | /** scaleHeight inherited */ |
1219 | 1219 | /** getImageSize inherited */ |
1220 | 1220 | |
1221 | | - /** getDescriptionUrl inherited */ |
1222 | | - /** getDescriptionText inherited */ |
| 1221 | + /** |
| 1222 | + * Get the URL of the file description page. |
| 1223 | + */ |
| 1224 | + function getDescriptionUrl() { |
| 1225 | + return $this->title->getLocalUrl(); |
| 1226 | + } |
1223 | 1227 | |
| 1228 | + /** |
| 1229 | + * Get the HTML text of the description page |
| 1230 | + * This is not used by ImagePage for local files, since (among other things) |
| 1231 | + * it skips the parser cache. |
| 1232 | + */ |
| 1233 | + function getDescriptionText() { |
| 1234 | + global $wgParser; |
| 1235 | + $revision = Revision::newFromTitle( $this->title ); |
| 1236 | + if ( !$revision ) return false; |
| 1237 | + $text = $revision->getText(); |
| 1238 | + if ( !$text ) return false; |
| 1239 | + $pout = $wgParser->parse( $text, $this->title, new ParserOptions() ); |
| 1240 | + return $pout->getText(); |
| 1241 | + } |
| 1242 | + |
1224 | 1243 | function getDescription() { |
1225 | 1244 | $this->load(); |
1226 | 1245 | return $this->description; |
Index: trunk/phase3/includes/filerepo/ForeignDBFile.php |
— | — | @@ -44,4 +44,14 @@ |
45 | 45 | function move( $target ) { |
46 | 46 | $this->readOnlyError(); |
47 | 47 | } |
| 48 | + |
| 49 | + function getDescriptionUrl() { |
| 50 | + // Restore remote behaviour |
| 51 | + return File::getDescriptionUrl(); |
| 52 | + } |
| 53 | + |
| 54 | + function getDescriptionText() { |
| 55 | + // Restore remote behaviour |
| 56 | + return File::getDescriptionText(); |
| 57 | + } |
48 | 58 | } |