* (bug 3852) "Redirected from" link no longer obscured on double-redirects
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 1 Nov 2005 06:48:29 +0000 (06:48 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 1 Nov 2005 06:48:29 +0000 (06:48 +0000)
RELEASE-NOTES
includes/Article.php

index 3ec4a41..ed1d9c3 100644 (file)
@@ -196,6 +196,7 @@ fully support the editing toolbar, but was found to be too confusing.
 * (bug 2885) Remove unnecessary reference parameter which broke classic skin
   talk notification on PHP 5.0.5
 * Fix Parser::unstrip on PHP 5.1.0RC4
+* (bug 3852) "Redirected from" link no longer obscured on double-redirects
 
 
 === Caveats ===
index 19866f6..424929b 100644 (file)
@@ -749,6 +749,7 @@ class Article {
                                $this->setOldSubtitle( isset($this->mOldId) ? $this->mOldId : $oldid );
                                $wgOut->setRobotpolicy( 'noindex,follow' );
                        }
+                       $wasRedirected = false;
                        if ( '' != $this->mRedirectedFrom ) {
                                if ( wfRunHooks( 'ArticleViewRedirect', array( &$this ) ) ) {
                                        $sk = $wgUser->getSkin();
@@ -757,6 +758,7 @@ class Article {
                                        $wgOut->setSubtitle( $s );
                                        # Can't cache redirects
                                        $pcache = false;
+                                       $wasRedirected = true;
                                }
                        } elseif ( !empty( $rdfrom ) ) {
                                global $wgRedirectSources;
@@ -765,6 +767,7 @@ class Article {
                                        $redir = $sk->makeExternalLink( $rdfrom, $rdfrom );
                                        $s = wfMsg( 'redirectedfrom', $redir );
                                        $wgOut->setSubtitle( $s );
+                                       $wasRedirected = true;
                                }
                        }
 
@@ -780,7 +783,9 @@ class Article {
                                # Display redirect
                                $imageDir = $wgContLang->isRTL() ? 'rtl' : 'ltr';
                                $imageUrl = $wgStylePath.'/common/images/redirect' . $imageDir . '.png';
-                               $wgOut->setSubtitle( wfMsgHtml( 'redirectpagesub' ) );
+                               if( !$wasRedirected ) {
+                                       $wgOut->setSubtitle( wfMsgHtml( 'redirectpagesub' ) );
+                               }
                                $targetUrl = $rt->escapeLocalURL();
                                $titleText = htmlspecialchars( $rt->getPrefixedText() );
                                $link = $sk->makeLinkObj( $rt );