Now that SpecialPage::getTitleValueFor() exists, use it so that we can
avoid returning a Title object uncessarily.
Change-Id: I5bf605baf2ecad62e189421a2e5c556cc0b6f6ac
/**
* @since 1.16.3
* @param LinkTarget $target
/**
* @since 1.16.3
* @param LinkTarget $target
- * @return LinkTarget|Title You will get back the same type you passed in, or a Title object
*/
public static function normaliseSpecialPage( LinkTarget $target ) {
if ( $target->getNamespace() == NS_SPECIAL ) {
*/
public static function normaliseSpecialPage( LinkTarget $target ) {
if ( $target->getNamespace() == NS_SPECIAL ) {
if ( !$name ) {
return $target;
}
if ( !$name ) {
return $target;
}
- $ret = SpecialPage::getTitleFor( $name, $subpage, $target->getFragment() );
+ $ret = SpecialPage::getTitleValueFor( $name, $subpage, $target->getFragment() );
return $ret;
} else {
return $target;
return $ret;
} else {
return $target;
}
}
} elseif ( isset( $frameParams['link-title'] ) && $frameParams['link-title'] !== '' ) {
}
}
} elseif ( isset( $frameParams['link-title'] ) && $frameParams['link-title'] !== '' ) {
- $mtoParams['custom-title-link'] = self::normaliseSpecialPage( $frameParams['link-title'] );
+ $mtoParams['custom-title-link'] = Title::newFromLinkTarget(
+ self::normaliseSpecialPage( $frameParams['link-title'] )
+ );
} elseif ( !empty( $frameParams['no-link'] ) ) {
// No link
} else {
} elseif ( !empty( $frameParams['no-link'] ) ) {
// No link
} else {