Index: trunk/phase3/includes/filerepo/LocalFile.php |
— | — | @@ -1121,28 +1121,9 @@ |
1122 | 1122 | /** scaleHeight inherited */ |
1123 | 1123 | /** getImageSize inherited */ |
1124 | 1124 | |
1125 | | - /** |
1126 | | - * Get the URL of the file description page. |
1127 | | - */ |
1128 | | - function getDescriptionUrl() { |
1129 | | - return $this->title->getLocalUrl(); |
1130 | | - } |
| 1125 | + /** getDescriptionUrl inherited */ |
| 1126 | + /** getDescriptionText inherited */ |
1131 | 1127 | |
1132 | | - /** |
1133 | | - * Get the HTML text of the description page |
1134 | | - * This is not used by ImagePage for local files, since (among other things) |
1135 | | - * it skips the parser cache. |
1136 | | - */ |
1137 | | - function getDescriptionText() { |
1138 | | - global $wgParser; |
1139 | | - $revision = Revision::newFromTitle( $this->title ); |
1140 | | - if ( !$revision ) return false; |
1141 | | - $text = $revision->getText(); |
1142 | | - if ( !$text ) return false; |
1143 | | - $pout = $wgParser->parse( $text, $this->title, new ParserOptions() ); |
1144 | | - return $pout->getText(); |
1145 | | - } |
1146 | | - |
1147 | 1128 | function getDescription() { |
1148 | 1129 | $this->load(); |
1149 | 1130 | return $this->description; |
Index: trunk/phase3/includes/filerepo/ForeignDBFile.php |
— | — | @@ -36,14 +36,4 @@ |
37 | 37 | function move( $target ) { |
38 | 38 | $this->readOnlyError(); |
39 | 39 | } |
40 | | - |
41 | | - function getDescriptionUrl() { |
42 | | - // Restore remote behaviour |
43 | | - return parent::getDescriptionUrl(); |
44 | | - } |
45 | | - |
46 | | - function getDescriptionText() { |
47 | | - // Restore remote behaviour |
48 | | - return parent::getDescriptionText(); |
49 | | - } |
50 | 40 | } |
Index: trunk/phase3/includes/filerepo/File.php |
— | — | @@ -1078,8 +1078,19 @@ |
1079 | 1079 | |
1080 | 1080 | /** |
1081 | 1081 | * Get the HTML text of the description page, if available |
| 1082 | + * For local files ImagePage does not use it, because it skips the parser cache. |
1082 | 1083 | */ |
1083 | 1084 | function getDescriptionText() { |
| 1085 | + if( $this->isLocal() ) { |
| 1086 | + global $wgParser; |
| 1087 | + $revision = Revision::newFromTitle( $this->title ); |
| 1088 | + if ( !$revision ) return false; |
| 1089 | + $text = $revision->getText(); |
| 1090 | + if ( !$text ) return false; |
| 1091 | + $pout = $wgParser->parse( $text, $this->title, new ParserOptions() ); |
| 1092 | + return $pout->getText(); |
| 1093 | + } |
| 1094 | + |
1084 | 1095 | global $wgMemc, $wgLang; |
1085 | 1096 | if ( !$this->repo->fetchDescription ) { |
1086 | 1097 | return false; |