r9123 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r9122‎ | r9123 | r9124 >
Date:16:56, 21 May 2005
Author:eloquence
Status:old
Tags:
Comment:
bug #73: category sortkeys are set to "Special:Upload" instead of the
filename when categories are added from the upload screen.
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -1207,7 +1207,13 @@
12081208
12091209 # Parse the text and replace links with placeholders
12101210 $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 );
12121218
12131219 # Look up the links in the DB and add them to the link cache
12141220 $wgOut->transformBuffer( RLH_FOR_UPDATE );
@@ -1972,7 +1978,6 @@
19731979 $shortTitle = $this->mTitle->getDBkey();
19741980
19751981 $adj = $this->mCountAdjustment;
1976 -
19771982 if ( 0 != $id ) {
19781983 $u = new LinksUpdate( $id, $title );
19791984 array_push( $wgDeferredUpdateList, $u );
Index: trunk/phase3/includes/OutputPage.php
@@ -228,10 +228,10 @@
229229 /**
230230 * Convert wikitext to HTML and add it to the buffer
231231 */
232 - function addWikiText( $text, $linestart = true ) {
 232+ function addWikiText( $text, $linestart = true, &$titleObj=false ) {
233233 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 );
236236 $this->mLanguageLinks += $parserOutput->getLanguageLinks();
237237 $this->mCategoryLinks += $parserOutput->getCategoryLinks();
238238 $this->addHTML( $parserOutput->getText() );

Follow-up revisions

RevisionCommit summaryAuthorDate
r9132bug #73, ext. editorseloquence07:05, 22 May 2005

Status & tagging log