- Only call WikiPage::getRedirectTarget once
- Use the result of getRedirectTarget to determine if the page info must
be shown,
because sometimes Title::isRedirect gets wrong state, see T172016 for
more information
Bug: T172016
Change-Id: Ic789207ba00d057a35e82a4c22628207eeb7b5fd
];
// Is it a redirect? If so, where to?
];
// Is it a redirect? If so, where to?
- if ( $title->isRedirect() ) {
+ $redirectTarget = $this->page->getRedirectTarget();
+ if ( $redirectTarget !== null ) {
$pageInfo['header-basic'][] = [
$this->msg( 'pageinfo-redirectsto' ),
$pageInfo['header-basic'][] = [
$this->msg( 'pageinfo-redirectsto' ),
- $linkRenderer->makeLink( $this->page->getRedirectTarget() ) .
+ $linkRenderer->makeLink( $redirectTarget ) .
$this->msg( 'word-separator' )->escaped() .
$this->msg( 'parentheses' )->rawParams( $linkRenderer->makeLink(
$this->msg( 'word-separator' )->escaped() .
$this->msg( 'parentheses' )->rawParams( $linkRenderer->makeLink(
- $this->page->getRedirectTarget(),
$this->msg( 'pageinfo-redirectsto-info' )->text(),
[],
[ 'action' => 'info' ]
$this->msg( 'pageinfo-redirectsto-info' )->text(),
[],
[ 'action' => 'info' ]