}
/**
- * Get the target language for the content being parsed. This is usually the
- * language that the content is in.
+ * Get the target language for the content being parsed. This is usually the
+ * language that the content is in.
*/
function getTargetLanguage() {
$target = $this->mOptions->getTargetLanguage();
$text = $this->maybeMakeExternalImage( $url );
if ( $text === false ) {
# Not an image, make a link
- $text = Linker::makeExternalLink( $url,
+ $text = Linker::makeExternalLink( $url,
$this->getConverterLanguage()->markNoConversion($url), true, 'free',
$this->getExternalLinkAttribs( $url ) );
# Register it in the output object...
}
if ( $this->getConverterLanguage()->hasVariants() ) {
- $selflink = $this->getConverterLanguage()->autoConvertToAllVariants(
+ $selflink = $this->getConverterLanguage()->autoConvertToAllVariants(
$this->mTitle->getPrefixedText() );
} else {
$selflink = array( $this->mTitle->getPrefixedText() );
* @private
*/
function braceSubstitution( $piece, $frame ) {
- global $wgNonincludableNamespaces, $wgContLang;
+ global $wgContLang;
wfProfileIn( __METHOD__ );
wfProfileIn( __METHOD__.'-setup' );
# Load from database
if ( !$found && $title ) {
- $titleProfileIn = __METHOD__ . "-title-" . $title->getDBKey();
- wfProfileIn( $titleProfileIn ); // template in
+ if ( !Profiler::instance()->isPersistent() ) {
+ # Too many unique items can kill profiling DBs/collectors
+ $titleProfileIn = __METHOD__ . "-title-" . $title->getDBKey();
+ wfProfileIn( $titleProfileIn ); // template in
+ }
wfProfileIn( __METHOD__ . '-loadtpl' );
if ( !$title->isExternal() ) {
if ( $title->isSpecialPage()
$isHTML = true;
$this->disableCache();
}
- } elseif ( $wgNonincludableNamespaces && in_array( $title->getNamespace(), $wgNonincludableNamespaces ) ) {
+ } elseif ( MWNamespace::isNonincludableNamespace( $title->getNamespace() ) ) {
$found = false; # access denied
wfDebug( __METHOD__.": template inclusion denied for " . $title->getPrefixedDBkey() );
} else {
) );
# Context links: [[|name]] and [[name (context)|]]
- global $wgLegalTitleChars;
- $tc = "[$wgLegalTitleChars]";
+ $tc = '[' . Title::legalChars() . ']';
$nc = '[ _0-9A-Za-z\x80-\xff-]'; # Namespaces can use non-ascii!
$p1 = "/\[\[(:?$nc+:|:|)($tc+?)( ?\\($tc+\\))\\|]]/"; # [[ns:page (context)|]]