var $mLangLinkLanguages;
/**
- * @var boolean Recursive call protection.
+ * @var bool Recursive call protection.
* This variable should be treated as if it were private.
*/
public $mInParse = false;
* Convert wikitext to HTML
* Do not call this function recursively.
*
- * @param string $text text we want to parse
+ * @param string $text Text we want to parse
* @param Title $title
* @param ParserOptions $options
* @param bool $linestart
/**
* Get the ParserOptions object
*
- * @return ParserOptions object
+ * @return ParserOptions
*/
function getOptions() {
return $this->mOptions;
* @since 1.19
*
* @throws MWException
- * @return Language|null
+ * @return Language
*/
public function getTargetLanguage() {
$target = $this->mOptions->getTargetLanguage();
*
* @param string $text
*
- * @return string the altered text
+ * @return string The altered text
*/
function doAllQuotes( $text ) {
wfProfileIn( __METHOD__ );
wfProfileOut( __METHOD__ . "-e1" );
wfProfileIn( __METHOD__ . "-misc" );
+ $origLink = $m[1];
+
# Don't allow internal links to pages containing
# PROTO: where PROTO is a valid URL protocol; these
# should be external links.
- if ( preg_match( '/^(?i:' . $this->mUrlProtocols . ')/', $m[1] ) ) {
+ if ( preg_match( '/^(?i:' . $this->mUrlProtocols . ')/', $origLink ) ) {
$s .= $prefix . '[[' . $line;
wfProfileOut( __METHOD__ . "-misc" );
continue;
# Make subpage if necessary
if ( $useSubpages ) {
- $link = $this->maybeDoSubpageLink( $m[1], $text );
+ $link = $this->maybeDoSubpageLink( $origLink, $text );
} else {
- $link = $m[1];
+ $link = $origLink;
}
- $noforce = ( substr( $m[1], 0, 1 ) !== ':' );
+ $noforce = ( substr( $origLink, 0, 1 ) !== ':' );
if ( !$noforce ) {
# Strip off leading ':'
$link = substr( $link, 1 );
}
# Link not escaped by : , create the various objects
- if ( $noforce ) {
+ if ( $noforce && !$nt->wasLocalInterwiki() ) {
# Interwikis
wfProfileIn( __METHOD__ . "-interwiki" );
if (