const TOC_END = '</mw:toc>';
# Persistent:
- var $mTagHooks = array();
- var $mTransparentTagHooks = array();
- var $mFunctionHooks = array();
- var $mFunctionSynonyms = array( 0 => array(), 1 => array() );
- var $mFunctionTagHooks = array();
- var $mStripList = array();
- var $mDefaultStripList = array();
- var $mVarCache = array();
- var $mImageParams = array();
- var $mImageParamsMagicArray = array();
- var $mMarkerIndex = 0;
- var $mFirstCall = true;
+ public $mTagHooks = array();
+ public $mTransparentTagHooks = array();
+ public $mFunctionHooks = array();
+ public $mFunctionSynonyms = array( 0 => array(), 1 => array() );
+ public $mFunctionTagHooks = array();
+ public $mStripList = array();
+ public $mDefaultStripList = array();
+ public $mVarCache = array();
+ public $mImageParams = array();
+ public $mImageParamsMagicArray = array();
+ public $mMarkerIndex = 0;
+ public $mFirstCall = true;
# Initialised by initialiseVariables()
/**
* @var MagicWordArray
*/
- var $mVariables;
+ public $mVariables;
/**
* @var MagicWordArray
*/
- var $mSubstWords;
- var $mConf, $mPreprocessor, $mExtLinkBracketedRegex, $mUrlProtocols; # Initialised in constructor
+ public $mSubstWords;
+ public $mConf, $mPreprocessor, $mExtLinkBracketedRegex, $mUrlProtocols; # Initialised in constructor
# Cleared with clearState():
/**
* @var ParserOutput
*/
- var $mOutput;
- var $mAutonumber, $mDTopen;
+ public $mOutput;
+ public $mAutonumber, $mDTopen;
/**
* @var StripState
*/
- var $mStripState;
+ public $mStripState;
- var $mIncludeCount, $mArgStack, $mLastSection, $mInPre;
+ public $mIncludeCount, $mArgStack, $mLastSection, $mInPre;
/**
* @var LinkHolderArray
*/
- var $mLinkHolders;
+ public $mLinkHolders;
- var $mLinkID;
- var $mIncludeSizes, $mPPNodeCount, $mGeneratedPPNodeCount, $mHighestExpansionDepth;
- var $mDefaultSort;
- var $mTplRedirCache, $mTplDomCache, $mHeadings, $mDoubleUnderscores;
- var $mExpensiveFunctionCount; # number of expensive parser function calls
- var $mShowToc, $mForceTocPosition;
+ public $mLinkID;
+ public $mIncludeSizes, $mPPNodeCount, $mGeneratedPPNodeCount, $mHighestExpansionDepth;
+ public $mDefaultSort;
+ public $mTplRedirCache, $mTplDomCache, $mHeadings, $mDoubleUnderscores;
+ public $mExpensiveFunctionCount; # number of expensive parser function calls
+ public $mShowToc, $mForceTocPosition;
/**
* @var User
*/
- var $mUser; # User object; only used when doing pre-save transform
+ public $mUser; # User object; only used when doing pre-save transform
# Temporary
# These are variables reset at least once per parse regardless of $clearState
/**
* @var ParserOptions
*/
- var $mOptions;
+ public $mOptions;
/**
* @var Title
*/
- var $mTitle; # Title context, used for self-link rendering and similar things
- var $mOutputType; # Output type, one of the OT_xxx constants
- var $ot; # Shortcut alias, see setOutputType()
- var $mRevisionObject; # The revision object of the specified revision ID
- var $mRevisionId; # ID to display in {{REVISIONID}} tags
- var $mRevisionTimestamp; # The timestamp of the specified revision ID
- var $mRevisionUser; # User to display in {{REVISIONUSER}} tag
- var $mRevisionSize; # Size to display in {{REVISIONSIZE}} variable
- var $mRevIdForTs; # The revision ID which was used to fetch the timestamp
- var $mInputSize = false; # For {{PAGESIZE}} on current page.
+ public $mTitle; # Title context, used for self-link rendering and similar things
+ public $mOutputType; # Output type, one of the OT_xxx constants
+ public $ot; # Shortcut alias, see setOutputType()
+ public $mRevisionObject; # The revision object of the specified revision ID
+ public $mRevisionId; # ID to display in {{REVISIONID}} tags
+ public $mRevisionTimestamp; # The timestamp of the specified revision ID
+ public $mRevisionUser; # User to display in {{REVISIONUSER}} tag
+ public $mRevisionSize; # Size to display in {{REVISIONSIZE}} variable
+ public $mRevIdForTs; # The revision ID which was used to fetch the timestamp
+ public $mInputSize = false; # For {{PAGESIZE}} on current page.
/**
* @var string
*/
- var $mUniqPrefix;
+ public $mUniqPrefix;
/**
* @var array Array with the language name of each language link (i.e. the
* interwiki prefix) in the key, value arbitrary. Used to avoid sending
* duplicate language links to the ParserOutput.
*/
- var $mLangLinkLanguages;
+ public $mLangLinkLanguages;
/**
* @var bool Recursive call protection.
/**
* Reduce memory usage to reduce the impact of circular references
*/
- function __destruct() {
+ public function __destruct() {
if ( isset( $this->mLinkHolders ) ) {
unset( $this->mLinkHolders );
}
/**
* Allow extensions to clean up when the parser is cloned
*/
- function __clone() {
+ public function __clone() {
$this->mInParse = false;
wfRunHooks( 'ParserCloned', array( $this ) );
}
/**
* Do various kinds of initialisation on the first call of the parser
*/
- function firstCallInit() {
+ public function firstCallInit() {
if ( !$this->mFirstCall ) {
return;
}
*
* @private
*/
- function clearState() {
+ public function clearState() {
wfProfileIn( __METHOD__ );
if ( $this->mFirstCall ) {
$this->firstCallInit();
*
* @return string
*/
- function recursiveTagParse( $text, $frame = false ) {
+ public function recursiveTagParse( $text, $frame = false ) {
wfProfileIn( __METHOD__ );
wfRunHooks( 'ParserBeforeStrip', array( &$this, &$text, &$this->mStripState ) );
wfRunHooks( 'ParserAfterStrip', array( &$this, &$text, &$this->mStripState ) );
* @param bool|PPFrame $frame
* @return mixed|string
*/
- function preprocess( $text, Title $title = null, ParserOptions $options, $revid = null, $frame = false ) {
+ public function preprocess( $text, Title $title = null, ParserOptions $options, $revid = null, $frame = false ) {
wfProfileIn( __METHOD__ );
$magicScopeVariable = $this->lock();
$this->startParse( $title, $options, self::OT_PREPROCESS, true );
*
* @param User|null $user User object or null (to reset)
*/
- function setUser( $user ) {
+ public function setUser( $user ) {
$this->mUser = $user;
}
*
* @param Title $t
*/
- function setTitle( $t ) {
+ public function setTitle( $t ) {
if ( !$t ) {
$t = Title::newFromText( 'NO TITLE' );
}
*
* @return Title
*/
- function getTitle() {
+ public function getTitle() {
return $this->mTitle;
}
* @param Title $x Title object or null to just get the current one
* @return Title
*/
- function Title( $x = null ) {
+ public function Title( $x = null ) {
return wfSetVar( $this->mTitle, $x );
}
*
* @param int $ot New value
*/
- function setOutputType( $ot ) {
+ public function setOutputType( $ot ) {
$this->mOutputType = $ot;
# Shortcut alias
$this->ot = array(
* @param int|null $x New value or null to just get the current one
* @return int
*/
- function OutputType( $x = null ) {
+ public function OutputType( $x = null ) {
return wfSetVar( $this->mOutputType, $x );
}
*
* @return ParserOutput
*/
- function getOutput() {
+ public function getOutput() {
return $this->mOutput;
}
*
* @return ParserOptions
*/
- function getOptions() {
+ public function getOptions() {
return $this->mOptions;
}
* @param ParserOptions $x New value or null to just get the current one
* @return ParserOptions Current ParserOptions object
*/
- function Options( $x = null ) {
+ public function Options( $x = null ) {
return wfSetVar( $this->mOptions, $x );
}
/**
* @return int
*/
- function nextLinkID() {
+ public function nextLinkID() {
return $this->mLinkID++;
}
/**
* @param int $id
*/
- function setLinkID( $id ) {
+ public function setLinkID( $id ) {
$this->mLinkID = $id;
}
* Get a language object for use in parser functions such as {{FORMATNUM:}}
* @return Language
*/
- function getFunctionLang() {
+ public function getFunctionLang() {
return $this->getTargetLanguage();
}
* @since 1.19
*
* @throws MWException
- * @return Language|null
+ * @return Language
*/
public function getTargetLanguage() {
$target = $this->mOptions->getTargetLanguage();
* Get the language object for language conversion
* @return Language|null
*/
- function getConverterLanguage() {
+ public function getConverterLanguage() {
return $this->getTargetLanguage();
}
*
* @return User
*/
- function getUser() {
+ public function getUser() {
if ( !is_null( $this->mUser ) ) {
return $this->mUser;
}
*
* @return Preprocessor
*/
- function getPreprocessor() {
+ public function getPreprocessor() {
if ( !isset( $this->mPreprocessor ) ) {
$class = $this->mPreprocessorClass;
$this->mPreprocessor = new $class( $this );
*
* @return array
*/
- function getStripList() {
+ public function getStripList() {
return $this->mStripList;
}
*
* @return string
*/
- function insertStripItem( $text ) {
+ public function insertStripItem( $text ) {
$rnd = "{$this->mUniqPrefix}-item-{$this->mMarkerIndex}-" . self::MARKER_SUFFIX;
$this->mMarkerIndex++;
$this->mStripState->addGeneral( $rnd, $text );
* @param string $text
* @return string
*/
- function doTableStuff( $text ) {
+ public function doTableStuff( $text ) {
wfProfileIn( __METHOD__ );
$lines = StringUtils::explode( "\n", $text );
*
* @return string
*/
- function internalParse( $text, $isMain = true, $frame = false ) {
+ public function internalParse( $text, $isMain = true, $frame = false ) {
wfProfileIn( __METHOD__ );
$origText = $text;
*
* @return string
*/
- function doMagicLinks( $text ) {
+ public function doMagicLinks( $text ) {
wfProfileIn( __METHOD__ );
$prots = wfUrlProtocolsWithoutProtRel();
$urlChar = self::EXT_LINK_URL_CLASS;
* @param array $m
* @return HTML|string
*/
- function magicLinkCallback( $m ) {
+ public function magicLinkCallback( $m ) {
if ( isset( $m[1] ) && $m[1] !== '' ) {
# Skip anchor
return $m[0];
* @return string HTML
* @private
*/
- function makeFreeExternalLink( $url ) {
+ public function makeFreeExternalLink( $url ) {
wfProfileIn( __METHOD__ );
$trail = '';
*
* @return string
*/
- function doHeadings( $text ) {
+ public function doHeadings( $text ) {
wfProfileIn( __METHOD__ );
for ( $i = 6; $i >= 1; --$i ) {
$h = str_repeat( '=', $i );
*
* @return string The altered text
*/
- function doAllQuotes( $text ) {
+ public function doAllQuotes( $text ) {
wfProfileIn( __METHOD__ );
$outtext = '';
$lines = StringUtils::explode( "\n", $text );
* @throws MWException
* @return string
*/
- function replaceExternalLinks( $text ) {
+ public function replaceExternalLinks( $text ) {
wfProfileIn( __METHOD__ );
$bits = preg_split( $this->mExtLinkBracketedRegex, $text, -1, PREG_SPLIT_DELIM_CAPTURE );
* nofollow if appropriate
* @return array Associative array of HTML attributes
*/
- function getExternalLinkAttribs( $url = false ) {
+ public function getExternalLinkAttribs( $url = false ) {
$attribs = array();
$attribs['rel'] = self::getExternalLinkRel( $url, $this->mTitle );
* the URL differently; as a workaround, just use the output for
* statistical records, not for actual linking/output.
*/
- static function replaceUnusualEscapes( $url ) {
+ public static function replaceUnusualEscapes( $url ) {
return preg_replace_callback( '/%[0-9A-Fa-f]{2}/',
array( __CLASS__, 'replaceUnusualEscapesCallback' ), $url );
}
*
* @private
*/
- function replaceInternalLinks( $s ) {
+ public function replaceInternalLinks( $s ) {
$this->mLinkHolders->merge( $this->replaceInternalLinks2( $s ) );
return $s;
}
*
* @private
*/
- function replaceInternalLinks2( &$s ) {
+ public function replaceInternalLinks2( &$s ) {
global $wgExtraInterlanguageLinkPrefixes;
wfProfileIn( __METHOD__ );
}
# Link not escaped by : , create the various objects
- if ( $noforce ) {
+ if ( $noforce && !$nt->wasLocalInterwiki() ) {
# Interwikis
wfProfileIn( __METHOD__ . "-interwiki" );
- # The final condition here is due to bug 68085
if (
$iw && $this->mOptions->getInterwikiMagic() && $nottalk && (
Language::fetchLanguageName( $iw, null, 'mw' ) ||
in_array( $iw, $wgExtraInterlanguageLinkPrefixes )
- ) && substr_compare( $this->getTargetLanguage()->lc( ltrim( $origLink ) ),
- $iw, 0, strlen( $iw ) ) === 0
+ )
) {
# Bug 24502: filter duplicates
if ( !isset( $this->mLangLinkLanguages[$iw] ) ) {
* @param string $prefix
* @return string HTML-wikitext mix oh yuck
*/
- function makeKnownLinkHolder( $nt, $text = '', $query = array(), $trail = '', $prefix = '' ) {
+ public function makeKnownLinkHolder( $nt, $text = '', $query = array(), $trail = '', $prefix = '' ) {
list( $inside, $trail ) = Linker::splitTrail( $trail );
if ( is_string( $query ) ) {
* @param string $text More-or-less HTML
* @return string Less-or-more HTML with NOPARSE bits
*/
- function armorLinks( $text ) {
+ public function armorLinks( $text ) {
return preg_replace( '/\b((?i)' . $this->mUrlProtocols . ')/',
"{$this->mUniqPrefix}NOPARSE$1", $text );
}
* Return true if subpage links should be expanded on this page.
* @return bool
*/
- function areSubpagesAllowed() {
+ public function areSubpagesAllowed() {
# Some namespaces don't allow subpages
return MWNamespace::hasSubpages( $this->mTitle->getNamespace() );
}
* @return string The full name of the link
* @private
*/
- function maybeDoSubpageLink( $target, &$text ) {
+ public function maybeDoSubpageLink( $target, &$text ) {
return Linker::normalizeSubpageLink( $this->mTitle, $target, $text );
}
*
* @return string
*/
- function closeParagraph() {
+ public function closeParagraph() {
$result = '';
if ( $this->mLastSection != '' ) {
$result = '</' . $this->mLastSection . ">\n";
*
* @return int
*/
- function getCommon( $st1, $st2 ) {
+ public function getCommon( $st1, $st2 ) {
$fl = strlen( $st1 );
$shorter = strlen( $st2 );
if ( $fl < $shorter ) {
*
* @return string
*/
- function openList( $char ) {
+ public function openList( $char ) {
$result = $this->closeParagraph();
if ( '*' === $char ) {
*
* @return string
*/
- function nextItem( $char ) {
+ public function nextItem( $char ) {
if ( '*' === $char || '#' === $char ) {
return "</li>\n<li>";
} elseif ( ':' === $char || ';' === $char ) {
*
* @return string
*/
- function closeList( $char ) {
+ public function closeList( $char ) {
if ( '*' === $char ) {
$text = "</li></ul>";
} elseif ( '#' === $char ) {
* @private
* @return string The lists rendered as HTML
*/
- function doBlockLevels( $text, $linestart ) {
+ public function doBlockLevels( $text, $linestart ) {
wfProfileIn( __METHOD__ );
# Parsing through the text line by line. The main thing
* @throws MWException
* @return string The position of the ':', or false if none found
*/
- function findColonNoLinks( $str, &$before, &$after ) {
+ public function findColonNoLinks( $str, &$before, &$after ) {
wfProfileIn( __METHOD__ );
$pos = strpos( $str, ':' );
* @throws MWException
* @return string
*/
- function getVariableValue( $index, $frame = false ) {
+ public function getVariableValue( $index, $frame = false ) {
global $wgContLang, $wgSitename, $wgServer, $wgServerName;
global $wgArticlePath, $wgScriptPath, $wgStylePath;
*
* @private
*/
- function initialiseVariables() {
+ public function initialiseVariables() {
wfProfileIn( __METHOD__ );
$variableIDs = MagicWord::getVariableIDs();
$substIDs = MagicWord::getSubstIDs();
*
* @return PPNode
*/
- function preprocessToDom( $text, $flags = 0 ) {
+ public function preprocessToDom( $text, $flags = 0 ) {
$dom = $this->getPreprocessor()->preprocessToObj( $text, $flags );
return $dom;
}
*
* @return array
*/
- static function createAssocArgs( $args ) {
+ public static function createAssocArgs( $args ) {
$assocArgs = array();
$index = 1;
foreach ( $args as $arg ) {
* @param string|int|null $max Maximum allowed, when an explicit limit has been
* exceeded, provide the values (optional)
*/
- function limitationWarn( $limitationType, $current = '', $max = '' ) {
+ public function limitationWarn( $limitationType, $current = '', $max = '' ) {
# does no harm if $current and $max are present but are unnecessary for the message
$warning = wfMessage( "$limitationType-warning" )->numParams( $current, $max )
->inLanguage( $this->mOptions->getUserLangObj() )->text();
*
* @return array
*/
- function getTemplateDom( $title ) {
+ public function getTemplateDom( $title ) {
$cacheTitle = $title;
$titleText = $title->getPrefixedDBkey();
* @param Title $title
* @return array ( string or false, Title )
*/
- function fetchTemplateAndTitle( $title ) {
+ public function fetchTemplateAndTitle( $title ) {
// Defaults to Parser::statelessFetchTemplate()
$templateCb = $this->mOptions->getTemplateCallback();
$stuff = call_user_func( $templateCb, $title, $this );
* @param Title $title
* @return string|bool
*/
- function fetchTemplate( $title ) {
+ public function fetchTemplate( $title ) {
$rv = $this->fetchTemplateAndTitle( $title );
return $rv[0];
}
*
* @return array
*/
- static function statelessFetchTemplate( $title, $parser = false ) {
+ public static function statelessFetchTemplate( $title, $parser = false ) {
$text = $skip = false;
$finalTitle = $title;
$deps = array();
* @param array $options Array of options to RepoGroup::findFile
* @return File|bool
*/
- function fetchFile( $title, $options = array() ) {
+ public function fetchFile( $title, $options = array() ) {
$res = $this->fetchFileAndTitle( $title, $options );
return $res[0];
}
* @param array $options Array of options to RepoGroup::findFile
* @return array ( File or false, Title of file )
*/
- function fetchFileAndTitle( $title, $options = array() ) {
+ public function fetchFileAndTitle( $title, $options = array() ) {
$file = $this->fetchFileNoRegister( $title, $options );
$time = $file ? $file->getTimestamp() : false;
*
* @return string
*/
- function interwikiTransclude( $title, $action ) {
+ public function interwikiTransclude( $title, $action ) {
global $wgEnableScaryTranscluding;
if ( !$wgEnableScaryTranscluding ) {
* @param string $url
* @return mixed|string
*/
- function fetchScaryTemplateMaybeFromCache( $url ) {
+ public function fetchScaryTemplateMaybeFromCache( $url ) {
global $wgTranscludeCacheExpiry;
$dbr = wfGetDB( DB_SLAVE );
$tsCond = $dbr->timestamp( time() - $wgTranscludeCacheExpiry );
*
* @return array
*/
- function argSubstitution( $piece, $frame ) {
+ public function argSubstitution( $piece, $frame ) {
wfProfileIn( __METHOD__ );
$error = false;
* @throws MWException
* @return string
*/
- function extensionSubstitution( $params, $frame ) {
+ public function extensionSubstitution( $params, $frame ) {
$name = $frame->expand( $params['name'] );
$attrText = !isset( $params['attr'] ) ? null : $frame->expand( $params['attr'] );
$content = !isset( $params['inner'] ) ? null : $frame->expand( $params['inner'] );
* @param int $size The size of the text
* @return bool False if this inclusion would take it over the maximum, true otherwise
*/
- function incrementIncludeSize( $type, $size ) {
+ public function incrementIncludeSize( $type, $size ) {
if ( $this->mIncludeSizes[$type] + $size > $this->mOptions->getMaxIncludeSize() ) {
return false;
} else {
*
* @return bool False if the limit has been exceeded
*/
- function incrementExpensiveFunctionCount() {
+ public function incrementExpensiveFunctionCount() {
$this->mExpensiveFunctionCount++;
return $this->mExpensiveFunctionCount <= $this->mOptions->getExpensiveParserFunctionLimit();
}
*
* @return string
*/
- function doDoubleUnderscore( $text ) {
+ public function doDoubleUnderscore( $text ) {
wfProfileIn( __METHOD__ );
# The position of __TOC__ needs to be recorded
* @return mixed|string
* @private
*/
- function formatHeadings( $text, $origText, $isMain = true ) {
+ public function formatHeadings( $text, $origText, $isMain = true ) {
global $wgMaxTocLevel, $wgExperimentalHtmlIds;
# Inhibit editsection links if requested in the page
if ( $isTemplate ) {
# Put a T flag in the section identifier, to indicate to extractSections()
# that sections inside <includeonly> should be counted.
- $editlinkArgs = array( $titleText, "T-$sectionIndex"/*, null */ );
+ $editsectionPage = $titleText;
+ $editsectionSection = "T-$sectionIndex";
+ $editsectionContent = null;
} else {
- $editlinkArgs = array(
- $this->mTitle->getPrefixedText(),
- $sectionIndex,
- $headlineHint
- );
+ $editsectionPage = $this->mTitle->getPrefixedText();
+ $editsectionSection = $sectionIndex;
+ $editsectionContent = $headlineHint;
}
// We use a bit of pesudo-xml for editsection markers. The
// language converter is run later on. Using a UNIQ style marker
// important bits of data, but put the headline hint inside a
// content block because the language converter is supposed to
// be able to convert that piece of data.
- $editlink = '<mw:editsection page="' . htmlspecialchars( $editlinkArgs[0] );
- $editlink .= '" section="' . htmlspecialchars( $editlinkArgs[1] ) . '"';
- if ( isset( $editlinkArgs[2] ) ) {
- $editlink .= '>' . $editlinkArgs[2] . '</mw:editsection>';
+ // Gets replaced with html in ParserOutput::getText
+ $editlink = '<mw:editsection page="' . htmlspecialchars( $editsectionPage );
+ $editlink .= '" section="' . htmlspecialchars( $editsectionSection ) . '"';
+ if ( $editsectionContent !== null ) {
+ $editlink .= '>' . $editsectionContent . '</mw:editsection>';
} else {
$editlink .= '/>';
}
* or null to use default value
* @return string
*/
- function getUserSig( &$user, $nickname = false, $fancySig = null ) {
+ public function getUserSig( &$user, $nickname = false, $fancySig = null ) {
global $wgMaxSigChars;
$username = $user->getName();
* @param string $text
* @return string|bool An expanded string, or false if invalid.
*/
- function validateSig( $text ) {
+ public function validateSig( $text ) {
return Xml::isWellFormedXmlFragment( $text ) ? $text : false;
}
* @throws MWException
* @return callable|null The old value of the mTagHooks array associated with the hook
*/
- function setTransparentTagHook( $tag, $callback ) {
+ public function setTransparentTagHook( $tag, $callback ) {
$tag = strtolower( $tag );
if ( preg_match( '/[<>\r\n]/', $tag, $m ) ) {
throw new MWException( "Invalid character {$m[0]} in setTransparentHook('$tag', ...) call" );
/**
* Remove all tag hooks
*/
- function clearTagHooks() {
+ public function clearTagHooks() {
$this->mTagHooks = array();
$this->mFunctionTagHooks = array();
$this->mStripList = $this->mDefaultStripList;
*
* @return array
*/
- function getFunctionHooks() {
+ public function getFunctionHooks() {
return array_keys( $this->mFunctionHooks );
}
* @throws MWException
* @return null
*/
- function setFunctionTagHook( $tag, $callback, $flags ) {
+ public function setFunctionTagHook( $tag, $callback, $flags ) {
$tag = strtolower( $tag );
if ( preg_match( '/[<>\r\n]/', $tag, $m ) ) {
throw new MWException( "Invalid character {$m[0]} in setFunctionTagHook('$tag', ...) call" );
*
* @return array Array of link CSS classes, indexed by PDBK.
*/
- function replaceLinkHolders( &$text, $options = 0 ) {
+ public function replaceLinkHolders( &$text, $options = 0 ) {
return $this->mLinkHolders->replace( $text );
}
* @param string $text
* @return string
*/
- function replaceLinkHoldersText( $text ) {
+ public function replaceLinkHoldersText( $text ) {
return $this->mLinkHolders->replaceText( $text );
}
* @param array $params
* @return string HTML
*/
- function renderImageGallery( $text, $params ) {
+ public function renderImageGallery( $text, $params ) {
wfProfileIn( __METHOD__ );
$mode = false;
* @param string $handler
* @return array
*/
- function getImageParams( $handler ) {
+ public function getImageParams( $handler ) {
if ( $handler ) {
$handlerClass = get_class( $handler );
} else {
* @param LinkHolderArray|bool $holders
* @return string HTML
*/
- function makeImage( $title, $options, $holders = false ) {
+ public function makeImage( $title, $options, $holders = false ) {
# Check if the options text is of the form "options|alt text"
# Options are:
# * thumbnail make a thumbnail with enlarge-icon and caption, alignment depends on lang
$paramName = 'no-link';
$value = true;
$validated = true;
- } elseif ( preg_match( "/^(?i)$prots/", $value ) ) {
+ } elseif ( preg_match( "/^((?i)$prots)/", $value ) ) {
if ( preg_match( "/^((?i)$prots)$chars+$/u", $value, $m ) ) {
$paramName = 'link-url';
$this->mOutput->addExternalLink( $value );
* Set a flag in the output object indicating that the content is dynamic and
* shouldn't be cached.
*/
- function disableCache() {
+ public function disableCache() {
wfDebug( "Parser output marked as uncacheable.\n" );
if ( !$this->mOutput ) {
throw new MWException( __METHOD__ .
* @param bool|PPFrame $frame
* @return string
*/
- function attributeStripCallback( &$text, $frame = false ) {
+ public function attributeStripCallback( &$text, $frame = false ) {
$text = $this->replaceVariables( $text, $frame );
$text = $this->mStripState->unstripBoth( $text );
return $text;
*
* @return array
*/
- function getTags() {
+ public function getTags() {
return array_merge(
array_keys( $this->mTransparentTagHooks ),
array_keys( $this->mTagHooks ),
*
* @return string
*/
- function replaceTransparentTags( $text ) {
+ public function replaceTransparentTags( $text ) {
$matches = array();
$elements = array_keys( $this->mTransparentTagHooks );
$text = self::extractTagsAndParams( $elements, $text, $matches, $this->mUniqPrefix );
*
* @return int|null
*/
- function getRevisionId() {
+ public function getRevisionId() {
return $this->mRevisionId;
}
* the default server-local timestamp
* @return string
*/
- function getRevisionTimestamp() {
+ public function getRevisionTimestamp() {
if ( is_null( $this->mRevisionTimestamp ) ) {
wfProfileIn( __METHOD__ );
*
* @return string User name
*/
- function getRevisionUser() {
+ public function getRevisionUser() {
if ( is_null( $this->mRevisionUser ) ) {
$revObject = $this->getRevisionObject();
*
* @return int|null Revision size
*/
- function getRevisionSize() {
+ public function getRevisionSize() {
if ( is_null( $this->mRevisionSize ) ) {
$revObject = $this->getRevisionObject();
*
* @return string
*/
- function testSrvus( $text, Title $title, ParserOptions $options, $outputType = self::OT_HTML ) {
+ public function testSrvus( $text, Title $title, ParserOptions $options, $outputType = self::OT_HTML ) {
$magicScopeVariable = $this->lock();
$this->startParse( $title, $options, $outputType, true );
* @param ParserOptions $options
* @return string
*/
- function testPst( $text, Title $title, ParserOptions $options ) {
+ public function testPst( $text, Title $title, ParserOptions $options ) {
return $this->preSaveTransform( $text, $title, $options->getUser(), $options );
}
* @param ParserOptions $options
* @return string
*/
- function testPreprocess( $text, Title $title, ParserOptions $options ) {
+ public function testPreprocess( $text, Title $title, ParserOptions $options ) {
return $this->testSrvus( $text, $title, $options, self::OT_PREPROCESS );
}
*
* @return string
*/
- function markerSkipCallback( $s, $callback ) {
+ public function markerSkipCallback( $s, $callback ) {
$i = 0;
$out = '';
while ( $i < strlen( $s ) ) {
* @param string $text Input string
* @return string
*/
- function killMarkers( $text ) {
+ public function killMarkers( $text ) {
return $this->mStripState->killMarkers( $text );
}
*
* @return array
*/
- function serializeHalfParsedText( $text ) {
+ public function serializeHalfParsedText( $text ) {
wfProfileIn( __METHOD__ );
$data = array(
'text' => $text,
* @throws MWException
* @return string
*/
- function unserializeHalfParsedText( $data ) {
+ public function unserializeHalfParsedText( $data ) {
if ( !isset( $data['version'] ) || $data['version'] != self::HALF_PARSED_VERSION ) {
throw new MWException( __METHOD__ . ': invalid version' );
}
*
* @return bool
*/
- function isValidHalfParsedText( $data ) {
+ public function isValidHalfParsedText( $data ) {
return isset( $data['version'] ) && $data['version'] == self::HALF_PARSED_VERSION;
}