Redirected from (using ?rdfrom=...) is not shown when page is cached
Closed, ResolvedPublic

Description

Author: bugzilla-wikimedia-org

Description:
Problem:
When $wgRedirectSources is enabled, the 'Redirected from ...' line is not shown if the page is
cached.

Reason (as far as I can tell):
In includes/Article.php, the part about redirects (starting '} elseif ( !empty( $rdfrom ) ) {') is
inside the 'if ( !$outputDone ) {' (if not cached) section but the redirected from line is not
cached (because it changes).

Quick Fix:

Change:
if ( $wgOut->tryParserCache( $this, $wgUser ) ) {
$outputDone = true;
}

To:
if ( $wgOut->tryParserCache( $this, $wgUser ) ) {
if ($rdfrom) {

		$sk = $wgUser->getSkin();
		$redir = $sk->makeExternalLink( $rdfrom, $rdfrom );
		$s = wfMsg( 'redirectedfrom', $redir );
		$wgOut->setSubtitle( $s );

}
$outputDone = true;
}


Version: 1.5.x
Severity: normal

bzimport added a project: MediaWiki-Parser.Via ConduitNov 21 2014, 8:47 PM
bzimport added a subscriber: wikibugs-l.
bzimport set Reference to bz3339.
bzimport created this task.Via LegacySep 2 2005, 9:47 PM
aaron added a comment.Via ConduitSep 27 2008, 11:56 PM

No longer the case it seems

Add Comment