r50135 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50134‎ | r50135 | r50136 >
Date:15:38, 2 May 2009
Author:catrope
Status:ok
Tags:
Comment:
Fix interesting regression from r49324: on a redirected page view, the content action tabs (article, discussion, edit, history) would point to the redirect instead of the target article.
Modified paths:
  • /trunk/phase3/includes/Wiki.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Wiki.php
@@ -60,7 +60,7 @@
6161 return;
6262 }
6363 if( !$this->initializeSpecialCases( $title, $output, $request ) ) {
64 - $new_article = $this->initializeArticle( $title, $request );
 64+ $new_article = $this->initializeArticle( $title, $output, $request );
6565 if( is_object( $new_article ) ) {
6666 $article = $new_article;
6767 $this->performAction( $output, $article, $title, $user, $request );
@@ -274,10 +274,11 @@
275275 * Create an Article object for the page, following redirects if needed.
276276 *
277277 * @param $title Title ($wgTitle)
278 - * @param $request WebRequest
 278+ * @param $output OutputPage ($wgOut)
 279+ * @param $request WebRequest ($wgRequest)
279280 * @return mixed an Article, or a string to redirect to another URL
280281 */
281 - function initializeArticle( &$title, $request ) {
 282+ function initializeArticle( &$title, &$output, $request ) {
282283 wfProfileIn( __METHOD__ );
283284
284285 $action = $this->getVal( 'action', 'view' );
@@ -324,6 +325,7 @@
325326 $rarticle->setRedirectedFrom( $title );
326327 $article = $rarticle;
327328 $title = $target;
 329+ $output->setTitle( $title );
328330 }
329331 }
330332 } else {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r49324Stage 2 of war on $wgTitle!! Make OutputPage, Skin and children rely on mTitl...demon02:22, 9 April 2009

Status & tagging log