Page MenuHomePhabricator

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

Details

Reference
bz3339

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 8:47 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz3339.
bzimport added a subscriber: Unknown Object (MLST).