reasons and have been deprecated: doMagicLinks, doDoubleUnderscore,
doHeadings, doAllQuotes, replaceExternalLinks, replaceInternalLinks,
replaceInternalLinks2, getVariableValue, initialiseVariables, formatHeadings,
- testPst, testPreprocess, testSrvus.
+ testPst, testPreprocess, testSrvus, areSubpagesAllowed, maybeDoSubpageLink.
=== Other changes in 1.34 ===
* Added option to specify "Various authors" as author in extension credits using
$prefix = '';
}
- $useSubpages = $this->areSubpagesAllowed();
+ # Some namespaces don't allow subpages
+ $useSubpages = $this->nsInfo->hasSubpages(
+ $this->mTitle->getNamespace()
+ );
# Loop for each link
for ( ; $line !== false && $line !== null; $a->next(), $line = $a->current() ) {
# Make subpage if necessary
if ( $useSubpages ) {
- $link = $this->maybeDoSubpageLink( $origLink, $text );
+ $link = Linker::normalizeSubpageLink(
+ $this->mTitle, $origLink, $text
+ );
} else {
$link = $origLink;
}
/**
* Return true if subpage links should be expanded on this page.
* @return bool
+ * @deprecated since 1.34; should not be used outside parser class.
*/
public function areSubpagesAllowed() {
# Some namespaces don't allow subpages
+ wfDeprecated( __METHOD__, '1.34' );
return $this->nsInfo->hasSubpages( $this->mTitle->getNamespace() );
}
* @param string &$text The link text, modified as necessary
* @return string The full name of the link
* @private
+ * @deprecated since 1.34; should not be used outside parser class.
*/
public function maybeDoSubpageLink( $target, &$text ) {
+ wfDeprecated( __METHOD__, '1.34' );
return Linker::normalizeSubpageLink( $this->mTitle, $target, $text );
}
$ns = NS_TEMPLATE;
# Split the title into page and subpage
$subpage = '';
- $relative = $this->maybeDoSubpageLink( $part1, $subpage );
+ $relative = Linker::normalizeSubpageLink(
+ $this->mTitle, $part1, $subpage
+ );
if ( $part1 !== $relative ) {
$part1 = $relative;
$ns = $this->mTitle->getNamespace();