From 5c6ebf26f6f3b54ae11a210072f5a16a3fbba4a7 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 1 Nov 2005 06:48:29 +0000 Subject: [PATCH] * (bug 3852) "Redirected from" link no longer obscured on double-redirects --- RELEASE-NOTES | 1 + includes/Article.php | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 3ec4a41d71..ed1d9c3c4c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/Article.php b/includes/Article.php index 19866f622d..424929bcc5 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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 ); -- 2.20.1