Index: trunk/phase3/includes/Wiki.php |
— | — | @@ -1,4 +1,7 @@ |
2 | 2 | <?php |
| 3 | +/** |
| 4 | + * MediaWiki is the to-be base class for this whole project |
| 5 | + */ |
3 | 6 | |
4 | 7 | class MediaWiki { |
5 | 8 | |
— | — | @@ -31,18 +34,24 @@ |
32 | 35 | # Reload from the page pointed to later |
33 | 36 | $article->mContentLoaded = false; |
34 | 37 | $ns = $rTitle->getNamespace(); |
35 | | - } |
| 38 | + $wasRedirected = true; |
| 39 | + } |
36 | 40 | } |
37 | 41 | |
38 | 42 | // Categories and images are handled by a different class |
39 | 43 | if( $ns == NS_IMAGE ) { |
| 44 | + $b4 = $title->getPrefixedText(); |
40 | 45 | unset( $article ); |
41 | 46 | 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 | + } |
43 | 52 | } elseif( $ns == NS_CATEGORY ) { |
44 | 53 | unset( $article ); |
45 | 54 | require_once( 'includes/CategoryPage.php' ); |
46 | | - return new CategoryPage( $title ); |
| 55 | + $article = new CategoryPage( $title ); |
47 | 56 | } |
48 | 57 | return $article; |
49 | 58 | } |