Index: trunk/phase3/includes/Article.php |
— | — | @@ -107,16 +107,11 @@ |
108 | 108 | /** |
109 | 109 | * Get the Title object this page redirects to |
110 | 110 | * |
111 | | - * @param bool $getFragment should the fragment be set on the title |
112 | 111 | * @return mixed false, Title of in-wiki target, or string with URL |
113 | 112 | */ |
114 | | - function followRedirect( $getFragment = false ) { |
115 | | - if( $getFragment ) |
116 | | - // We'll need to use the content of this page, as Article::getRedirectTarget() |
117 | | - // now loads the data from redirect table, wich doesn't store the fragment |
118 | | - $rt = Title::newFromRedirect( $this->getContent() ); |
119 | | - else |
120 | | - $rt = $this->getRedirectTarget(); |
| 113 | + function followRedirect() { |
| 114 | + $text = $this->getContent(); |
| 115 | + $rt = Title::newFromRedirect( $text ); |
121 | 116 | |
122 | 117 | # process if title object is valid and not special:userlogout |
123 | 118 | if( $rt ) { |
— | — | @@ -857,7 +852,7 @@ |
858 | 853 | |
859 | 854 | } |
860 | 855 | |
861 | | - elseif ( $rt = $this->getRedirectTarget() ) { |
| 856 | + elseif ( $rt = Title::newFromRedirect( $text ) ) { |
862 | 857 | # Display redirect |
863 | 858 | $imageDir = $wgContLang->isRTL() ? 'rtl' : 'ltr'; |
864 | 859 | $imageUrl = $wgStylePath.'/common/images/redirect' . $imageDir . '.png'; |
Index: trunk/phase3/includes/Wiki.php |
— | — | @@ -288,7 +288,7 @@ |
289 | 289 | |
290 | 290 | // Follow redirects only for... redirects |
291 | 291 | if( $article->mIsRedirect ) { |
292 | | - $target = $article->followRedirect( true /* getFragment */ ); |
| 292 | + $target = $article->followRedirect(); |
293 | 293 | if( is_string( $target ) ) { |
294 | 294 | if( !$this->getVal( 'DisableHardRedirects' ) ) { |
295 | 295 | // we'll need to redirect |