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