Index: trunk/phase3/includes/Article.php |
— | — | @@ -1207,7 +1207,13 @@ |
1208 | 1208 | |
1209 | 1209 | # Parse the text and replace links with placeholders |
1210 | 1210 | $wgOut = new OutputPage(); |
1211 | | - $wgOut->addWikiText( $text ); |
| 1211 | + |
| 1212 | + # Pass the current title along (use linestart default) |
| 1213 | + # in case we're creating a wiki page which is different |
| 1214 | + # than the currently displayed one (e.g. image pages |
| 1215 | + # craeted on file uploads); otherwise, link updates will |
| 1216 | + # go wrong. |
| 1217 | + $wgOut->addWikiText( $text, true, $this->mTitle ); |
1212 | 1218 | |
1213 | 1219 | # Look up the links in the DB and add them to the link cache |
1214 | 1220 | $wgOut->transformBuffer( RLH_FOR_UPDATE ); |
— | — | @@ -1972,7 +1978,6 @@ |
1973 | 1979 | $shortTitle = $this->mTitle->getDBkey(); |
1974 | 1980 | |
1975 | 1981 | $adj = $this->mCountAdjustment; |
1976 | | - |
1977 | 1982 | if ( 0 != $id ) { |
1978 | 1983 | $u = new LinksUpdate( $id, $title ); |
1979 | 1984 | array_push( $wgDeferredUpdateList, $u ); |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -228,10 +228,10 @@ |
229 | 229 | /** |
230 | 230 | * Convert wikitext to HTML and add it to the buffer |
231 | 231 | */ |
232 | | - function addWikiText( $text, $linestart = true ) { |
| 232 | + function addWikiText( $text, $linestart = true, &$titleObj=false ) { |
233 | 233 | global $wgParser, $wgTitle, $wgUseTidy; |
234 | | - |
235 | | - $parserOutput = $wgParser->parse( $text, $wgTitle, $this->mParserOptions, $linestart ); |
| 234 | + $title = $titleObj ? $titleObj : $wgTitle; |
| 235 | + $parserOutput = $wgParser->parse( $text, $title, $this->mParserOptions, $linestart ); |
236 | 236 | $this->mLanguageLinks += $parserOutput->getLanguageLinks(); |
237 | 237 | $this->mCategoryLinks += $parserOutput->getCategoryLinks(); |
238 | 238 | $this->addHTML( $parserOutput->getText() ); |