r12603 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r12602‎ | r12603 | r12604 >
Date:09:24, 11 January 2006
Author:magnus_manske
Status:old
Tags:
Comment:
Image redirect fix back in
* "Redirected from" worked before, and works now
* Fixed "redirect=no"
Modified paths:
  • /trunk/phase3/includes/Wiki.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Wiki.php
@@ -1,4 +1,7 @@
22 <?php
 3+/**
 4+ * MediaWiki is the to-be base class for this whole project
 5+ */
36
47 class MediaWiki {
58
@@ -31,18 +34,24 @@
3235 # Reload from the page pointed to later
3336 $article->mContentLoaded = false;
3437 $ns = $rTitle->getNamespace();
35 - }
 38+ $wasRedirected = true;
 39+ }
3640 }
3741
3842 // Categories and images are handled by a different class
3943 if( $ns == NS_IMAGE ) {
 44+ $b4 = $title->getPrefixedText();
4045 unset( $article );
4146 require_once( 'includes/ImagePage.php' );
42 - return new ImagePage( $title );
 47+ $article = new ImagePage( $title );
 48+ if( isset( $wasRedirected ) && $request->getVal( 'redirect' ) != 'no' ) {
 49+ $article->mTitle = $rTitle;
 50+ $article->mRedirectedFrom = $b4;
 51+ }
4352 } elseif( $ns == NS_CATEGORY ) {
4453 unset( $article );
4554 require_once( 'includes/CategoryPage.php' );
46 - return new CategoryPage( $title );
 55+ $article = new CategoryPage( $title );
4756 }
4857 return $article;
4958 }

Status & tagging log