r12590 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r12589‎ | r12590 | r12591 >
Date:23:57, 10 January 2006
Author:vibber
Status:old
Tags:
Comment:
Reverting image redirect fix; side effects:
* no 'redirected from' backlink
* redirect=no mode failed to work
Modified paths:
  • /trunk/phase3/includes/Wiki.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Wiki.php
@@ -1,23 +1,13 @@
22 <?php
3 -/**
4 - * MediaWiki is the to-be base class for this whole project
5 -*/
63
7 -
84 class MediaWiki {
95
106 var $params = array();
11 -
12 - /**
13 - * Stores parameters (to avoid using globals)
14 - */
 7+
158 function setVal( $key, &$value ) {
169 $this->param[strtolower( $key )] = $value;
1710 }
18 -
19 - /**
20 - * Retrieves parameters
21 - */
 11+
2212 function getVal( $key, $default = "" ) {
2313 $key = strtolower( $key );
2414 if( isset( $this->params[$key] ) ) {
@@ -26,11 +16,7 @@
2717 return $default;
2818 }
2919
30 - /**
31 - * Creates the article to be known as $wgArticle
32 - */
33 - function initializeArticle( &$title, &$request, $action ) {
34 - // Fix Media namespace
 20+ function initializeArticle( &$title, $request, $action ) {
3521 if( NS_MEDIA == $title->getNamespace() ) {
3622 $title = Title::makeTitle( NS_IMAGE, $title->getDBkey() );
3723 }
@@ -45,31 +31,22 @@
4632 # Reload from the page pointed to later
4733 $article->mContentLoaded = false;
4834 $ns = $rTitle->getNamespace();
49 - $wasRedirected = true;
5035 }
5136 }
5237
5338 // Categories and images are handled by a different class
5439 if( $ns == NS_IMAGE ) {
55 - $b4 = $title->getPrefixedText();
5640 unset($article);
5741 require_once( 'includes/ImagePage.php' );
58 - $article = new ImagePage( $title );
59 - if( isset( $wasRedirected ) ) {
60 - $article->mTitle = $rTitle;
61 - $article->mRedirectedFrom = $b4;
62 - }
 42+ return new ImagePage( $title );
6343 } elseif( $ns == NS_CATEGORY ) {
6444 unset($article);
6545 require_once( 'includes/CategoryPage.php' );
66 - $article = new CategoryPage( $title );
 46+ return new CategoryPage( $title );
6747 }
6848 return $article;
6949 }
7050
71 - /**
72 - * Performs any of a wide range of passed actions
73 - */
7451 function performAction( $action, &$output, &$article, &$title, &$user, &$request ) {
7552 switch( $action ) {
7653 case 'view':

Status & tagging log