Parser Class Reference
[Parser]

PHP Parser - Processes wiki markup (which uses a more user-friendly syntax, such as "[[link]]" for making links), and provides a one-way transformation of that wiki markup it into XHTML output / markup (which in turn the browser understands, and can display). More...

Inherited by Parser_LinkHooks.

List of all members.

Public Member Functions

 __construct ($conf=array())
 #@-
 __destruct ()
 Reduce memory usage to reduce the impact of circular references.
 firstCallInit ()
 Do various kinds of initialisation on the first call of the parser.
 clearState ()
 Clear Parser state.
 setOutputType ($ot)
 setTitle ($t)
 Set the context title.
 uniqPrefix ()
 Accessor for mUniqPrefix.
 parse ($text, Title $title, ParserOptions $options, $linestart=true, $clearState=true, $revid=null)
 Convert wikitext to HTML Do not call this function recursively.
 recursiveTagParse ($text)
 Recursive parser entry point that can be called from an extension tag hook.
 preprocess ($text, $title, $options, $revid=null)
 Expand templates and variables in the text, producing valid, static wikitext.
getTitle ()
 getOptions ()
 getRevisionId ()
 getOutput ()
 nextLinkID ()
 getFunctionLang ()
 getPreprocessor ()
 Get a preprocessor object.
 getStripList ()
 Get a list of strippable XML-like elements.
 strip ($text, $state, $stripcomments=false, $dontstrip=array())
 unstripForHTML ($text)
 internalParse ($text)
 Helper function for parse() that transforms wiki markup into HTML.
 doMagicLinks ($text)
 Replace special strings like "ISBN xxx" and "RFC xxx" with magic external links.
 magicLinkCallback ($m)
 makeFreeExternalLink ($url)
 Make a free external link, given a user-supplied URL.
 doHeadings ($text)
 Parse headers and return html.
 doAllQuotes ($text)
 Replace single quotes with HTML markup.
 doQuotes ($text)
 Helper function for doAllQuotes().
 getExternalLinkAttribs ($url=false)
 Get an associative array of additional HTML attributes appropriate for a particular external link.
 maybeMakeExternalImage ($url)
 make an image if it's allowed, either through the global option, through the exception, or through the on-wiki whitelist
 replaceInternalLinks ($s)
 Process [[ ]] wikilinks.
 replaceInternalLinks2 (&$s)
 Process [[ ]] wikilinks (RIL).
 makeLinkHolder (&$nt, $text= '', $query= '', $trail= '', $prefix= '')
 Make a link placeholder.
 makeKnownLinkHolder ($nt, $text= '', $query= '', $trail= '', $prefix= '')
 Render a forced-blue link inline; protect against double expansion of URLs if we're in a mode that prepends full URL prefixes to internal links.
 armorLinks ($text)
 Insert a NOPARSE hacky thing into any inline links in a chunk that's going to go through further parsing steps before inline URL expansion.
 areSubpagesAllowed ()
 Return true if subpage links should be expanded on this page.
 closeParagraph ()
 #@+ Used by doBlockLevels()
 getCommon ($st1, $st2)
 openList ($char)
 nextItem ($char)
 closeList ($char)
 doBlockLevels ($text, $linestart)
 #@-
 findColonNoLinks ($str, &$before, &$after)
 Split up a string on ':', ignoring any occurences inside tags to prevent illegal overlapping.
 getVariableValue ($index)
 Return value of a magic variable (like PAGENAME).
 initialiseVariables ()
 initialise the magic variables (like CURRENTMONTHNAME)
 preprocessToDom ($text, $flags=0)
 Preprocess some wikitext and return the document tree.
 replaceVariables ($text, $frame=false, $argsOnly=false)
 Replace magic variables, templates, and template arguments with the appropriate text.
 limitationWarn ($limitationType, $current=null, $max=null)
 Warn the user when a parser limitation is reached Will warn at most once the user per limitation type.
 braceSubstitution ($piece, $frame)
 Return the text of a template, after recursively replacing any variables or templates within the template.
 getTemplateDom ($title)
 Get the semi-parsed DOM representation of a template with a given title, and its redirect destination title.
 fetchTemplateAndTitle ($title)
 Fetch the unparsed text of a template and register a reference to it.
 fetchTemplate ($title)
 interwikiTransclude ($title, $action)
 Transclude an interwiki link.
 fetchScaryTemplateMaybeFromCache ($url)
 extensionSubstitution ($params, $frame)
 Return the text to be used for a given extension tag.
 incrementIncludeSize ($type, $size)
 Increment an include size counter.
 incrementExpensiveFunctionCount ()
 Increment the expensive function count.
 doDoubleUnderscore ($text)
 Strip double-underscore items like __NOGALLERY__ and __NOTOC__ Fills $this->mDoubleUnderscores, returns the modified text.
 formatHeadings ($text, $isMain=true)
 This function accomplishes several tasks: 1) Auto-number headings if that option is enabled 2) Add an [edit] link to sections for users who have enabled the option and can edit the page 3) Add a Table of contents on the top for users who have enabled the option 4) Auto-anchor headings.
 preSaveTransform ($text, Title $title, $user, $options, $clearState=true)
 Transform wiki markup when saving a page by doing
->
conversion, substitting signatures, {{subst:}} templates, etc.
 getUserSig (&$user)
 Fetch the user's signature text, if any, and normalize to validated, ready-to-insert wikitext.
 validateSig ($text)
 Check that the user's signature contains no bad XML.
 cleanSig ($text, $parsing=false)
 Clean up signature text.
 cleanSigInSig ($text)
 Strip ~~~, ~~~~ and ~~~~~ out of signatures.
 startExternalParse (&$title, $options, $outputType, $clearState=true)
 Set up some variables which are usually set up in parse() so that an external function can call some class members with confidence.
 transformMsg ($text, $options)
 Wrapper for preprocess().
 setHook ($tag, $callback)
 Create an HTML-style tag, e.g.
 setTransparentTagHook ($tag, $callback)
 clearTagHooks ()
 Remove all tag hooks.
 setFunctionHook ($id, $callback, $flags=0)
 Create a function, e.g.
 getFunctionHooks ()
 Get all registered function hook identifiers.
 replaceLinkHolders (&$text, $options=0)
 Replace link placeholders with actual links, in the buffer Placeholders created in Skin::makeLinkObj() Returns an array of link CSS classes, indexed by PDBK.
 replaceLinkHoldersText ($text)
 Replace link placeholders with plain text of links (not HTML-formatted).
 renderPreTag ($text, $attribs)
 Tag hook handler for 'pre'.
 renderImageGallery ($text, $params)
 Renders an image gallery from a text with one line per image.
 getImageParams ($handler)
 makeImage ($title, $options, $holders=false)
 Parse image options text and use it to make an image.
 disableCache ()
 Set a flag in the output object indicating that the content is dynamic and shouldn't be cached.
 attributeStripCallback (&$text, $frame=false)
 #@+ Callback from the Sanitizer for expanding items found in HTML attribute values, so they can be safely tested and escaped.
 Title ($x=NULL)
 #@-
 Options ($x=NULL)
 OutputType ($x=NULL)
 getTags ()
 #@-
 getSection ($text, $section, $deftext='')
 This function returns the text of a section, specified by a number ($section).
 replaceSection ($oldtext, $section, $text)
 getRevisionTimestamp ()
 Get the timestamp associated with the current revision, adjusted for the default server-local timestamp.
 getRevisionUser ()
 Get the name of the user that edited the last revision.
 setDefaultSort ($sort)
 Mutator for $mDefaultSort.
 getDefaultSort ()
 Accessor for $mDefaultSort Will use the title/prefixed title if none is set.
 getCustomDefaultSort ()
 Accessor for $mDefaultSort Unlike getDefaultSort(), will return false if none is set.
 guessSectionNameFromWikiText ($text)
 Try to guess the section anchor name based on a wikitext fragment presumably extracted from a heading, for example "Header" from "== Header ==".
 stripSectionName ($text)
 Strips a text string of wikitext for use in a section anchor.
 srvus ($text)
 testSrvus ($text, $title, $options, $outputType=self::OT_HTML)
 strip/replaceVariables/unstrip for preprocessor regression testing
 testPst ($text, $title, $options)
 testPreprocess ($text, $title, $options)
 markerSkipCallback ($s, $callback)
 serialiseHalfParsedText ($text)
 unserialiseHalfParsedText ($data, $intPrefix=null)

Static Public Member Functions

 extractTagsAndParams ($elements, $text, &$matches, $uniq_prefix= '')
 Replaces all occurrences of HTML-style comments and the given tags in the text with a random marker and returns the next text.
static tidy ($text)
 Interface with html tidy.
static replaceUnusualEscapes ($url)
 Replace unusual URL escape codes with their equivalent characters.
static splitWhitespace ($s)
static createAssocArgs ($args)
 Clean up argument array - refactored in 1.9 so parserfunctions can use it, too.
static statelessFetchTemplate ($title, $parser=false)
 Static function to get a template Can be overridden via ParserOptions::setTemplateCallback().

Public Attributes

const VERSION = '1.6.4'
 Update this version number when the ParserOutput format changes in an incompatible way, so the parser cache can automatically discard old data.
const SFH_NO_HASH = 1
const SFH_OBJECT_ARGS = 2
const EXT_LINK_URL_CLASS = '[^][<>"\\x00-\\x20\\x7F]'
const EXT_IMAGE_REGEX
const COLON_STATE_TEXT = 0
const COLON_STATE_TAG = 1
const COLON_STATE_TAGSTART = 2
const COLON_STATE_CLOSETAG = 3
const COLON_STATE_TAGSLASH = 4
const COLON_STATE_COMMENT = 5
const COLON_STATE_COMMENTDASH = 6
const COLON_STATE_COMMENTDASHDASH = 7
const PTD_FOR_INCLUSION = 1
const OT_HTML = 1
const OT_WIKI = 2
const OT_PREPROCESS = 3
const OT_MSG = 3
const MARKER_SUFFIX = "-QINU\x7f"
 $mTagHooks
 #@+
 $mTransparentTagHooks
 $mFunctionHooks
 $mFunctionSynonyms
 $mVariables
 $mImageParams
 $mImageParamsMagicArray
 $mStripList
 $mMarkerIndex
 $mPreprocessor
 $mExtLinkBracketedRegex
 $mUrlProtocols
 $mDefaultStripList
 $mVarCache
 $mConf
 $mOutput
 $mAutonumber
 $mDTopen
 $mStripState
 $mIncludeCount
 $mArgStack
 $mLastSection
 $mInPre
 $mLinkHolders
 $mLinkID
 $mIncludeSizes
 $mPPNodeCount
 $mDefaultSort
 $mTplExpandCache
 $mTplRedirCache
 $mTplDomCache
 $mHeadings
 $mDoubleUnderscores
 $mExpensiveFunctionCount
 $mFileCache
 $mOptions
 $mTitle
 $mOutputType
 $ot
 $mRevisionId
 $mRevisionTimestamp
 $mRevIdForTs

Protected Member Functions

 stripAltText ($caption, $holders)

Private Member Functions

 unstrip ($text, $state)
 Restores pre, math, and other extensions removed by strip().
 unstripNoWiki ($text, $state)
 Always call this after unstrip() to preserve the order.
 insertStripItem ($text)
 Add an item to the strip state Returns the unique tag which must be inserted into the stripped text The tag will be replaced with the original text in unstrip().
 doTableStuff ($text)
 parse the wiki syntax used to render tables
 replaceExternalLinks ($text)
 Replace external links (REL).
 maybeDoSubpageLink ($target, &$text)
 Handle link to subpage if necessary.
 argSubstitution ($piece, $frame)
 Triple brace replacement -- used for template arguments.
 pstPass2 ($text, $user)
 Pre-save transform helper function.
 extractSections ($text, $section, $mode, $newText='')
 #@-

Static Private Member Functions

 getRandomString ()
 Get a random string.
static replaceUnusualEscapesCallback ($matches)
 Callback function used in replaceUnusualEscapes().


Detailed Description

PHP Parser - Processes wiki markup (which uses a more user-friendly syntax, such as "[[link]]" for making links), and provides a one-way transformation of that wiki markup it into XHTML output / markup (which in turn the browser understands, and can display).

 There are five main entry points into the Parser class:
 parse()
   produces HTML output
 preSaveTransform().
   produces altered wiki markup.
 preprocess()
   removes HTML comments and expands templates
 cleanSig()
   Cleans a signature before saving it to preferences
 extractSections()
   Extracts sections from an article for section editing

 Globals used:
    objects:   $wgLang, $wgContLang

 NOT $wgArticle, $wgUser or $wgTitle. Keep them away!

 settings:
  $wgUseTex*, $wgUseDynamicDates*, $wgInterwikiMagic*,
  $wgNamespacesWithSubpages, $wgAllowExternalImages*,
  $wgLocaltimezone, $wgAllowSpecialInclusion*,
  $wgMaxArticleSize*

  * only within ParserOptions
 

Definition at line 46 of file Parser.php.


Constructor & Destructor Documentation

Parser::__construct ( conf = array()  ) 

#@-

Constructor

Access:
public

Reimplemented in Parser_LinkHooks.

Definition at line 125 of file Parser.php.

References $conf, wfDebug(), and wfUrlProtocols().

Parser::__destruct (  ) 

Reduce memory usage to reduce the impact of circular references.

Definition at line 154 of file Parser.php.

References $name.


Member Function Documentation

Parser::areSubpagesAllowed (  ) 

Return true if subpage links should be expanded on this page.

Returns:
bool

Definition at line 1819 of file Parser.php.

References MWNamespace::hasSubpages().

Referenced by replaceInternalLinks2(), and Parser_LinkHooks::replaceInternalLinksCallback().

Parser::argSubstitution ( piece,
frame 
) [private]

Triple brace replacement -- used for template arguments.

Definition at line 3148 of file Parser.php.

References $error, $text, wfProfileIn(), and wfProfileOut().

Parser::armorLinks ( text  ) 

Insert a NOPARSE hacky thing into any inline links in a chunk that's going to go through further parsing steps before inline URL expansion.

Not needed quite as much as it used to be since free links are a bit more sensible these days. But bracketed links are still an issue.

Parameters:
string more-or-less HTML
Returns:
string less-or-more HTML with NOPARSE bits

Definition at line 1810 of file Parser.php.

References $text, and wfUrlProtocols().

Referenced by replaceInternalLinks2().

Parser::attributeStripCallback ( &$  text,
frame = false 
)

#@+ Callback from the Sanitizer for expanding items found in HTML attribute values, so they can be safely tested and escaped.

Parameters:
string $text
PPFrame $frame
Returns:
string
Access:
private

Definition at line 4444 of file Parser.php.

References $text.

Parser::braceSubstitution ( piece,
frame 
)

Return the text of a template, after recursively replacing any variables or templates within the template.

Parameters:
array $piece The parts of the template $piece['title']: the title, i.e. the part before the | $piece['parts']: the parameter array $piece['lineStart']: whether the brace was at the start of a line
PPFrame The current frame, contains template arguments
Returns:
string the text of the template
Access:
private

Definition at line 2695 of file Parser.php.

References $args, $flags, $i, $ns, $result, $text, $wgNonincludableNamespaces, SpecialPage::capturePath(), MagicWord::get(), MagicWord::getCacheTTL(), is(), Title::newFromText(), PPFrame::RECOVER_ORIG, wfDebug(), wfEscapeWikiText(), wfMsgForContent(), wfProfileIn(), and wfProfileOut().

Parser::cleanSig ( text,
parsing = false 
)

Clean up signature text.

1) Strip ~~~, ~~~~ and ~~~~~ out of signatures

See also:
cleanSigInSig 2) Substitute all transclusions
Parameters:
string $text
$parsing Whether we're cleaning (preferences save) or parsing
Returns:
string Signature text

Definition at line 3860 of file Parser.php.

References $text, $wgTitle, and MagicWord::get().

Parser::cleanSigInSig ( text  ) 

Strip ~~~, ~~~~ and ~~~~~ out of signatures.

Parameters:
string $text
Returns:
string Signature text with /~{3,5}/ removed

Definition at line 3898 of file Parser.php.

References $text.

Parser::clearState (  ) 

Clear Parser state.

Access:
private

Definition at line 187 of file Parser.php.

References firstCallInit(), getRandomString(), wfProfileIn(), wfProfileOut(), and wfRunHooks().

Referenced by parse().

Parser::clearTagHooks (  ) 

Remove all tag hooks.

Definition at line 3980 of file Parser.php.

Parser::closeList ( char  ) 

Definition at line 1963 of file Parser.php.

References $text.

Parser::closeParagraph (  ) 

#@+ Used by doBlockLevels()

Access:
private

Definition at line 1907 of file Parser.php.

References $result.

static Parser::createAssocArgs ( args  )  [static]

Clean up argument array - refactored in 1.9 so parserfunctions can use it, too.

Definition at line 2639 of file Parser.php.

References $args, and $name.

Parser::disableCache (  ) 

Set a flag in the output object indicating that the content is dynamic and shouldn't be cached.

Definition at line 4431 of file Parser.php.

References wfDebug().

Parser::doAllQuotes ( text  ) 

Replace single quotes with HTML markup.

Access:
private
Returns:
string the altered text

Definition at line 1053 of file Parser.php.

References $text, doQuotes(), StringUtils::explode(), wfProfileIn(), and wfProfileOut().

Referenced by internalParse().

Parser::doBlockLevels ( text,
linestart 
)

#@-

Make lists from lines starting with ':', '*', '#', etc. (DBL)

Access:
private
Returns:
string the lists rendered as HTML

Definition at line 1985 of file Parser.php.

References $output, $prefix, $t, $text, StringUtils::explode(), wfProfileIn(), and wfProfileOut().

Referenced by parse().

Parser::doDoubleUnderscore ( text  ) 

Strip double-underscore items like __NOGALLERY__ and __NOTOC__ Fills $this->mDoubleUnderscores, returns the modified text.

Definition at line 3309 of file Parser.php.

References $text, MagicWord::get(), MagicWord::getDoubleUnderscoreArray(), Title::makeTitleSafe(), wfDebug(), wfMsgForContent(), wfProfileIn(), and wfProfileOut().

Referenced by internalParse().

Parser::doHeadings ( text  ) 

Parse headers and return html.

Access:
private

Definition at line 1037 of file Parser.php.

References $i, $text, wfProfileIn(), and wfProfileOut().

Referenced by internalParse().

Parser::doMagicLinks ( text  ) 

Replace special strings like "ISBN xxx" and "RFC xxx" with magic external links.

DML

Access:
private

Definition at line 915 of file Parser.php.

References $text, wfProfileIn(), and wfProfileOut().

Referenced by internalParse().

Parser::doQuotes ( text  ) 

Helper function for doAllQuotes().

Definition at line 1068 of file Parser.php.

References $i, $output, and $text.

Referenced by doAllQuotes().

Parser::doTableStuff ( text  )  [private]

parse the wiki syntax used to render tables

Definition at line 666 of file Parser.php.

References $out, and table.

Referenced by internalParse().

Parser::extensionSubstitution ( params,
frame 
)

Return the text to be used for a given extension tag.

This is the ghost of strip().

Parameters:
array $params Associative array of parameters: name PPNode for the tag name attr PPNode for unparsed text where tag attributes are thought to be attributes Optional associative array of parsed attributes inner Contents of extension element noClose Original text did not have a close tag
PPFrame $frame

Definition at line 3201 of file Parser.php.

References $name, $output, $wgRawHtml, Sanitizer::decodeTagAttributes(), Xml::escapeTagsOnly(), and MathRenderer::renderMath().

Parser::extractSections ( text,
section,
mode,
newText = '' 
) [private]

#@-

Break wikitext input into sections, and either pull or replace some particular section's text.

External callers should use the getSection and replaceSection methods.

Parameters:
string $text Page wikitext
string $section A section identifier string of the form: <flag1> - <flag2> - ... - <section number>="">
Currently the only recognised flag is "T", which means the target section number was derived during a template inclusion parse, in other words this is a template section edit link. If no flags are given, it was an ordinary section edit link. This flag is required to avoid a section numbering mismatch when a section is enclosed by <includeonly> (bug 6563).

The section number 0 pulls the text before the first heading; other numbers will pull the given section along with its lower-level subsections. If the section is not found, $mode=get will return $newtext, and $mode=replace will return $text.

Parameters:
string $mode One of "get" or "replace"
string $newText Replacement text for section data.
Returns:
string for "get", the extracted section text. for "replace", the whole page with the section replaced.

Definition at line 4492 of file Parser.php.

References $flags, $mode, $section, $text, $wgTitle, and PPFrame::RECOVER_ORIG.

Parser::extractTagsAndParams ( elements,
text,
&$  matches,
uniq_prefix = '' 
) [static]

Replaces all occurrences of HTML-style comments and the given tags in the text with a random marker and returns the next text.

The output parameter $matches will be an associative array filled with data in the form: 'UNIQ-xxxxx' => array( 'element', 'tag content', array( 'param' => 'x' ), '<element param="x">tag content</element>' ) )

Parameters:
$elements list of element names. Comments are always extracted.
$text Source text string.
$uniq_prefix 

Definition at line 526 of file Parser.php.

Referenced by parse().

Parser::fetchScaryTemplateMaybeFromCache ( url  ) 

Definition at line 3118 of file Parser.php.

References $dbr, $dbw, $obj, $text, $url, $wgTranscludeCacheExpiry, Http::get(), wfGetDB(), and wfMsg().

Parser::fetchTemplate ( title  ) 

Definition at line 3035 of file Parser.php.

Parser::fetchTemplateAndTitle ( title  ) 

Fetch the unparsed text of a template and register a reference to it.

Definition at line 3022 of file Parser.php.

References $text.

Parser::findColonNoLinks ( str,
&$  before,
&$  after 
)

Split up a string on ':', ignoring any occurences inside tags to prevent illegal overlapping.

Parameters:
string $str the string to split
string &$before set to everything before the ':'
string &$after set to everything after the ':' return string the position of the ':', or false if none found

Definition at line 2158 of file Parser.php.

References $i, wfDebug(), wfProfileIn(), and wfProfileOut().

Parser::firstCallInit (  ) 

Do various kinds of initialisation on the first call of the parser.

Reimplemented in Parser_LinkHooks.

Definition at line 166 of file Parser.php.

References initialiseVariables(), CoreParserFunctions::register(), setHook(), wfProfileIn(), wfProfileOut(), and wfRunHooks().

Referenced by clearState().

Parser::formatHeadings ( text,
isMain = true 
)

This function accomplishes several tasks: 1) Auto-number headings if that option is enabled 2) Add an [edit] link to sections for users who have enabled the option and can edit the page 3) Add a Table of contents on the top for users who have enabled the option 4) Auto-anchor headings.

It loops through all headlines, collects the necessary data, then splits up the string and re-inserts the newly formatted headlines.

Parameters:
string $text
boolean $isMain
Access:
private

Definition at line 3371 of file Parser.php.

References $i, $text, $wgEnforceHtmlIds, $wgMaxTocLevel, Sanitizer::escapeId(), and Title::newFromText().

Referenced by internalParse().

Parser::getCommon ( st1,
st2 
)

Definition at line 1919 of file Parser.php.

References $i.

Parser::getCustomDefaultSort (  ) 

Accessor for $mDefaultSort Unlike getDefaultSort(), will return false if none is set.

Returns:
string or false

Definition at line 4685 of file Parser.php.

Parser::getDefaultSort (  ) 

Accessor for $mDefaultSort Will use the title/prefixed title if none is set.

Returns:
string

Definition at line 4667 of file Parser.php.

References $wgCategoryPrefixedDefaultSortkey.

Referenced by replaceInternalLinks2().

Parser::getExternalLinkAttribs ( url = false  ) 

Get an associative array of additional HTML attributes appropriate for a particular external link.

This currently may include rel => nofollow (depending on configuration, namespace, and the URL's domain) and/or a target attribute (depending on configuration).

Parameters:
string $url Optional URL, to extract the domain from for rel => nofollow if appropriate
Returns:
array Associative array of HTML attributes

Definition at line 1325 of file Parser.php.

References $ns, $url, $wgNoFollowDomainExceptions, $wgNoFollowLinks, $wgNoFollowNsExceptions, and wfParseUrl().

Referenced by makeFreeExternalLink(), and replaceExternalLinks().

Parser::getFunctionHooks (  ) 

Get all registered function hook identifiers.

Returns:
array

Definition at line 4064 of file Parser.php.

Parser::getFunctionLang (  ) 

Definition at line 486 of file Parser.php.

Referenced by replaceExternalLinks().

Parser::getImageParams ( handler  ) 

Definition at line 4175 of file Parser.php.

References $name, and $type.

Parser::getOptions (  ) 

Definition at line 481 of file Parser.php.

Parser::getOutput (  ) 

Definition at line 483 of file Parser.php.

Parser::getPreprocessor (  ) 

Get a preprocessor object.

Definition at line 500 of file Parser.php.

Parser::getRandomString (  )  [static, private]

Get a random string.

Definition at line 476 of file Parser.php.

Referenced by Parser_DiffTest::__construct(), and clearState().

Parser::getRevisionId (  ) 

Definition at line 482 of file Parser.php.

Parser::getRevisionTimestamp (  ) 

Get the timestamp associated with the current revision, adjusted for the default server-local timestamp.

Definition at line 4609 of file Parser.php.

References $dbr, wfGetDB(), wfProfileIn(), wfProfileOut(), and wfTimestamp().

Parser::getRevisionUser (  ) 

Get the name of the user that edited the last revision.

Definition at line 4639 of file Parser.php.

References $revision, $wgUser, and Revision::newFromId().

Parser::getSection ( text,
section,
deftext = '' 
)

This function returns the text of a section, specified by a number ($section).

A section is text under a heading like == Heading == or <h1>Heading</h1>, or the first section before any such heading (section 0).

If a section contains subsections, these are also returned.

Parameters:
string $text text to look in
string $section section identifier
string $deftext default to return if section is not found
Returns:
string text of the requested section

Definition at line 4597 of file Parser.php.

References $section, and $text.

Parser::getStripList (  ) 

Get a list of strippable XML-like elements.

Definition at line 591 of file Parser.php.

Parser::getTags (  ) 

#@-

#@+ Accessor

Definition at line 4463 of file Parser.php.

Parser::getTemplateDom ( title  ) 

Get the semi-parsed DOM representation of a template with a given title, and its redirect destination title.

Cached.

Definition at line 2987 of file Parser.php.

References $ns, $text, Title::equals(), Title::getDBkey(), Title::getNamespace(), Title::getPrefixedDBkey(), and Title::makeTitle().

& Parser::getTitle (  ) 

Definition at line 480 of file Parser.php.

Parser::getUserSig ( &$  user  ) 

Fetch the user's signature text, if any, and normalize to validated, ready-to-insert wikitext.

Parameters:
User $user
Returns:
string
Access:
private

Definition at line 3805 of file Parser.php.

References $user, $username, $wgMaxSigChars, wfDebug(), wfEscapeWikiText(), and wfMsgExt().

Parser::getVariableValue ( index  ) 

Parser::guessSectionNameFromWikiText ( text  ) 

Try to guess the section anchor name based on a wikitext fragment presumably extracted from a heading, for example "Header" from "== Header ==".

Definition at line 4694 of file Parser.php.

References $text, Sanitizer::decodeCharReferences(), and StringUtils::delimiterReplace().

Parser::incrementExpensiveFunctionCount (  ) 

Increment the expensive function count.

Returns:
boolean False if the limit has been exceeded

Definition at line 3296 of file Parser.php.

References $wgExpensiveParserFunctionLimit.

Parser::incrementIncludeSize ( type,
size 
)

Increment an include size counter.

Parameters:
string $type The type of expansion
integer $size The size of the text
Returns:
boolean False if this inclusion would take it over the maximum, true otherwise

Definition at line 3282 of file Parser.php.

References $size, and $type.

Parser::initialiseVariables (  ) 

initialise the magic variables (like CURRENTMONTHNAME)

Access:
private

Definition at line 2548 of file Parser.php.

References MagicWord::getVariableIDs(), wfProfileIn(), and wfProfileOut().

Referenced by Parser_LinkHooks::firstCallInit(), and firstCallInit().

Parser::insertStripItem ( text  )  [private]

Add an item to the strip state Returns the unique tag which must be inserted into the stripped text The tag will be replaced with the original text in unstrip().

Definition at line 645 of file Parser.php.

Parser::internalParse ( text  ) 

Helper function for parse() that transforms wiki markup into HTML.

Only called for $mOutputType == self::OT_HTML.

Access:
private

Definition at line 865 of file Parser.php.

References $text, doAllQuotes(), doDoubleUnderscore(), doHeadings(), doMagicLinks(), doTableStuff(), formatHeadings(), DateFormatter::getInstance(), Sanitizer::removeHTMLtags(), replaceExternalLinks(), replaceInternalLinks(), replaceVariables(), wfProfileIn(), wfProfileOut(), and wfRunHooks().

Referenced by parse().

Parser::interwikiTransclude ( title,
action 
)

Transclude an interwiki link.

Definition at line 3105 of file Parser.php.

References $url, $wgEnableScaryTranscluding, and wfMsg().

Parser::limitationWarn ( limitationType,
current = null,
max = null 
)

Warn the user when a parser limitation is reached Will warn at most once the user per limitation type.

Parameters:
string $limitationType, should be one of: 'expensive-parserfunction' (corresponding messages: 'expensive-parserfunction-warning', 'expensive-parserfunction-category') 'post-expand-template-argument' (corresponding messages: 'post-expand-template-argument-warning', 'post-expand-template-argument-category') 'post-expand-template-inclusion' (corresponding messages: 'post-expand-template-inclusion-warning', 'post-expand-template-inclusion-category') int $current, $max When an explicit limit has been exceeded, provide the values (optional)

Definition at line 2672 of file Parser.php.

References Title::makeTitleSafe(), wfMsgExt(), and wfMsgForContent().

Parser::magicLinkCallback ( m  ) 

Definition at line 935 of file Parser.php.

References $url, SpecialPage::getTitleFor(), makeFreeExternalLink(), and wfMsg().

Parser::makeFreeExternalLink ( url  ) 

Make a free external link, given a user-supplied URL.

Returns:
HTML
Access:
private

Definition at line 985 of file Parser.php.

References $sep, $text, $url, Sanitizer::cleanUrl(), getExternalLinkAttribs(), maybeMakeExternalImage(), replaceUnusualEscapes(), wfProfileIn(), and wfProfileOut().

Referenced by magicLinkCallback().

Parser::makeImage ( title,
options,
holders = false 
)

Parse image options text and use it to make an image.

Parameters:
Title $title
string $options
LinkHolderArray $holders

Definition at line 4221 of file Parser.php.

References $file, $type, StringUtils::explode(), Title::getDBkey(), Title::newFromText(), wfFindFile(), and wfRunHooks().

Referenced by replaceInternalLinks2().

Parser::makeKnownLinkHolder ( nt,
text = '',
query = '',
trail = '',
prefix = '' 
)

Render a forced-blue link inline; protect against double expansion of URLs if we're in a mode that prepends full URL prefixes to internal links.

Since this little disaster has to split off the trail text to avoid breaking URLs in the following text without breaking trails on the wiki links, it's been made into a horrible function.

Parameters:
Title $nt
string $text
string $query
string $trail
string $prefix
Returns:
string HTML-wikitext mix oh yuck

Definition at line 1793 of file Parser.php.

References $prefix, $text, and Linker::splitTrail().

Referenced by replaceInternalLinks2().

Parser::makeLinkHolder ( &$  nt,
text = '',
query = '',
trail = '',
prefix = '' 
)

Make a link placeholder.

The text returned can be later resolved to a real link with replaceLinkHolders(). This is done for two reasons: firstly to avoid further parsing of interwiki links, and secondly to allow all existence checks and article length checks (for stub links) to be bundled into a single query.

Deprecated:

Definition at line 1775 of file Parser.php.

References $prefix, and $text.

Parser::markerSkipCallback ( s,
callback 
)

Definition at line 4780 of file Parser.php.

References $i, $out, and $s.

Parser::maybeDoSubpageLink ( target,
&$  text 
) [private]

Handle link to subpage if necessary.

Parameters:
string $target the source of the link
string &$text the link text, modified as necessary
Returns:
string the full name of the link

Definition at line 1831 of file Parser.php.

References $suffix, $text, is(), wfProfileIn(), and wfProfileOut().

Referenced by replaceInternalLinks2(), and Parser_LinkHooks::replaceInternalLinksCallback().

Parser::maybeMakeExternalImage ( url  ) 

make an image if it's allowed, either through the global option, through the exception, or through the on-wiki whitelist

Access:
private

Definition at line 1392 of file Parser.php.

References $text, $url, and wfMsgForContent().

Referenced by makeFreeExternalLink(), and replaceExternalLinks().

Parser::nextItem ( char  ) 

Definition at line 1947 of file Parser.php.

Parser::nextLinkID (  ) 

Definition at line 484 of file Parser.php.

Parser::openList ( char  ) 

Definition at line 1932 of file Parser.php.

References $result.

Parser::Options ( x = NULL  ) 

Definition at line 4456 of file Parser.php.

References wfSetVar().

Parser::OutputType ( x = NULL  ) 

Definition at line 4457 of file Parser.php.

References wfSetVar().

Parser::parse ( text,
Title title,
ParserOptions options,
linestart = true,
clearState = true,
revid = null 
)

Convert wikitext to HTML Do not call this function recursively.

Parameters:
$text String: text we want to parse
$title A title object
$options ParserOptions
$linestart boolean
$clearState boolean
$revid Int: number to pass in {{REVISIONID}}
Returns:
ParserOutput a ParserOutput

Definition at line 300 of file Parser.php.

References $fname, $output, $text, $wgAlwaysUseTidy, $wgContLang, $wgUseTidy, clearState(), doBlockLevels(), extractTagsAndParams(), internalParse(), is(), Sanitizer::normalizeCharReferences(), replaceLinkHolders(), setOutputType(), setTitle(), tidy(), wfGetCaller(), wfProfileIn(), and wfRunHooks().

Parser::preprocess ( text,
title,
options,
revid = null 
)

Expand templates and variables in the text, producing valid, static wikitext.

Also removes comments.

Definition at line 453 of file Parser.php.

Parser::preprocessToDom ( text,
flags = 0 
)

Preprocess some wikitext and return the document tree.

This is the ghost of replace_variables().

Parameters:
string $text The text to parse
integer flags Bitwise combination of: self::PTD_FOR_INCLUSION Handle <noinclude>/<includeonly> as if the text is being included. Default is to assume a direct page view.
The generated DOM tree must depend only on the input text and the flags. The DOM tree must be the same in OT_HTML and OT_WIKI mode, to avoid a regression of bug 4899.

Any flag added to the $flags parameter here, or any other parameter liable to cause a change in the DOM tree for a given text, must be passed through the section identifier in the section edit link and thus back to extractSections().

The output of this function is currently only cached in process memory, but a persistent cache may be implemented at a later date which takes further advantage of these strict dependency requirements.

Access:
private

Definition at line 2578 of file Parser.php.

References $flags, and $text.

Parser::preSaveTransform ( text,
Title title,
user,
options,
clearState = true 
)

Transform wiki markup when saving a page by doing
->
conversion, substitting signatures, {{subst:}} templates, etc.

Parameters:
string $text the text to transform
Title &$title the Title object for the current article
User $user the User object describing the current user
ParserOptions $options parsing options
bool $clearState whether to clear the parser state first
Returns:
string the altered wiki markup

Definition at line 3698 of file Parser.php.

References $text, and $user.

Parser::pstPass2 ( text,
user 
) [private]

Pre-save transform helper function.

Definition at line 3720 of file Parser.php.

References $key, $t, $text, $ts, $user, $wgLegalTitleChars, $wgLocaltimezone, wfEmptyMsg(), wfMsgForContent(), and wfTimestamp().

Parser::recursiveTagParse ( text  ) 

Recursive parser entry point that can be called from an extension tag hook.

Definition at line 440 of file Parser.php.

Parser::renderImageGallery ( text,
params 
)

Renders an image gallery from a text with one line per image.

text labels may be given by using |-style alternative text. E.g. Image:one.jpg|The number "1" Image:tree.jpg|A tree given as text will return the HTML of a gallery with two images, labeled 'The number "1"' and 'A tree'.

Definition at line 4109 of file Parser.php.

References $text, StringUtils::explode(), Title::newFromText(), Sanitizer::validateTagAttributes(), and wfRunHooks().

Parser::renderPreTag ( text,
attribs 
)

Tag hook handler for 'pre'.

Definition at line 4090 of file Parser.php.

References $text, StringUtils::delimiterReplace(), Xml::escapeTagsOnly(), Xml::openElement(), and Sanitizer::validateTagAttributes().

Parser::replaceExternalLinks ( text  )  [private]

Replace external links (REL).

Note: this is all very hackish and the order of execution matters a lot. Make sure to run maintenance/parserTests.php if you change this code.

Definition at line 1238 of file Parser.php.

References $i, $s, $text, $url, Sanitizer::cleanUrl(), getExternalLinkAttribs(), getFunctionLang(), maybeMakeExternalImage(), replaceUnusualEscapes(), Linker::splitTrail(), wfProfileIn(), wfProfileOut(), and wfUrlProtocols().

Referenced by internalParse(), and replaceInternalLinks2().

Parser::replaceInternalLinks ( s  ) 

Process [[ ]] wikilinks.

Returns:
processed text
Access:
private

Definition at line 1441 of file Parser.php.

References $s, and replaceInternalLinks2().

Referenced by internalParse().

Parser::replaceInternalLinks2 ( &$  s  ) 

Parser::replaceLinkHolders ( &$  text,
options = 0 
)

Replace link placeholders with actual links, in the buffer Placeholders created in Skin::makeLinkObj() Returns an array of link CSS classes, indexed by PDBK.

Definition at line 4073 of file Parser.php.

References $text.

Referenced by parse().

Parser::replaceLinkHoldersText ( text  ) 

Replace link placeholders with plain text of links (not HTML-formatted).

Parameters:
string $text
Returns:
string

Definition at line 4083 of file Parser.php.

References $text.

Parser::replaceSection ( oldtext,
section,
text 
)

Definition at line 4601 of file Parser.php.

References $section, and $text.

static Parser::replaceUnusualEscapes ( url  )  [static]

Replace unusual URL escape codes with their equivalent characters.

Parameters:
string 
Returns:
string
Todo:
This can merge genuinely required bits in the path or query string, breaking legit URLs. A proper fix would treat the various parts of the URL differently; as a workaround, just use the output for statistical records, not for actual linking/output.

Definition at line 1363 of file Parser.php.

References $url.

Referenced by makeFreeExternalLink(), and replaceExternalLinks().

static Parser::replaceUnusualEscapesCallback ( matches  )  [static, private]

Callback function used in replaceUnusualEscapes().

Replaces unusual URL escape codes with their equivalent character

Definition at line 1374 of file Parser.php.

Parser::replaceVariables ( text,
frame = false,
argsOnly = false 
)

Replace magic variables, templates, and template arguments with the appropriate text.

Templates are substituted recursively, taking care to avoid infinite loops.

Note that the substitution depends on value of $mOutputType: self::OT_WIKI: only {{subst:}} templates self::OT_PREPROCESS: templates but not extension tags self::OT_HTML: all templates and extension tags

Parameters:
string $tex The text to transform
PPFrame $frame Object describing the arguments passed to the template. Arguments may also be provided as an associative array, as was the usual case before MW1.12. Providing arguments this way may be useful for extensions wishing to perform variable replacement explicitly.
bool $argsOnly Only do argument (triple-brace) expansion, not double-brace expansion
Access:
private

Definition at line 2616 of file Parser.php.

References $flags, $text, PPFrame::NO_TEMPLATES, wfDebug(), wfProfileIn(), and wfProfileOut().

Referenced by internalParse().

Parser::serialiseHalfParsedText ( text  ) 

Definition at line 4804 of file Parser.php.

References $key, $ns, and $text.

Parser::setDefaultSort ( sort  ) 

Mutator for $mDefaultSort.

Parameters:
$sort New value

Definition at line 4657 of file Parser.php.

References $sort.

Parser::setFunctionHook ( id,
callback,
flags = 0 
)

Create a function, e.g.

{{sum:1|2|3}} The callback function should have the form: function myParserFunction( &$parser, $arg1, $arg2, $arg3 ) { ... }

Or with SFH_OBJECT_ARGS: function myParserFunction( $parser, $frame, $args ) { ... }

The callback may either return the text result of the function, or an array with the text in element 0, and a number of flags in the other elements. The names of the flags are specified in the keys. Valid flags are: found The text returned is valid, stop processing the template. This is on by default. nowiki Wiki markup in the return value should be escaped isHTML The returned text is HTML, armour it against wikitext transformation

Parameters:
string $id The magic word ID
mixed $callback The callback function (and object) to use
integer $flags a combination of the following flags: SFH_NO_HASH No leading hash, i.e. {{plural:...}} instead of {{if:...}}
SFH_OBJECT_ARGS Pass the template arguments as PPNode objects instead of text. This allows for conditional expansion of the parse tree, allowing you to eliminate dead branches and thus speed up parsing. It is also possible to analyse the parse tree of the arguments, and to control the way they are expanded.

The $frame parameter is a PPFrame. This can be used to produce expanded text from the arguments, for instance: $text = isset( $args[0] ) ? $frame->expand( $args[0] ) : '';

For technical reasons, $args[0] is pre-expanded and will be a string. This may change in future versions. Please call $frame->expand() on it anyway so that your code keeps working if/when this is changed.

If you want whitespace to be trimmed from $args, you need to do it yourself, post- expansion.

Please read the documentation in includes/parser/Preprocessor.php for more information about the methods available in PPFrame and PPNode.

Returns:
The old callback function for this name, if any

Definition at line 4029 of file Parser.php.

References $flags, and MagicWord::get().

Parser::setHook ( tag,
callback 
)

Create an HTML-style tag, e.g.

<yourtag>special text</yourtag> The callback should have the following form: function myParserHook( $text, $params, &$parser ) { ... }

Transform and return $text. Use $parser for any required context, e.g. use $parser->getTitle() and $parser->getOptions() not $wgTitle or $wgOut->mParserOptions

Parameters:
mixed $tag The tag to use, e.g. 'hook' for <hook>
mixed $callback The callback function (and object) to use for the tag
Returns:
The old value of the mTagHooks array associated with the hook

Definition at line 3958 of file Parser.php.

Referenced by Parser_LinkHooks::firstCallInit(), and firstCallInit().

Parser::setOutputType ( ot  ) 

Definition at line 244 of file Parser.php.

References $ot.

Referenced by parse().

Parser::setTitle ( t  ) 

Set the context title.

Definition at line 257 of file Parser.php.

References $t, and Title::newFromText().

Referenced by parse().

Parser::setTransparentTagHook ( tag,
callback 
)

Definition at line 3969 of file Parser.php.

static Parser::splitWhitespace ( s  )  [static]

Definition at line 2586 of file Parser.php.

References $s.

Parser::srvus ( text  ) 

Definition at line 4744 of file Parser.php.

References $text.

Parser::startExternalParse ( &$  title,
options,
outputType,
clearState = true 
)

Set up some variables which are usually set up in parse() so that an external function can call some class members with confidence.

Definition at line 3908 of file Parser.php.

static Parser::statelessFetchTemplate ( title,
parser = false 
) [static]

Parser::strip ( text,
state,
stripcomments = false,
dontstrip = array () 
)

Deprecated:
use replaceVariables

Definition at line 606 of file Parser.php.

Parser::stripAltText ( caption,
holders 
) [protected]

Definition at line 4408 of file Parser.php.

References Sanitizer::stripAllTags().

Parser::stripSectionName ( text  ) 

Strips a text string of wikitext for use in a section anchor.

Accepts a text string and then removes all wikitext from the string and leaves only the resultant text (i.e. the result of [[User:WikiSysop|Sysop]] would be "Sysop" and the result of [[User:WikiSysop]] would be "User:WikiSysop") - this is intended to create valid section anchors by mimicing the output of the parser when headings are parsed.

Parameters:
$text string Text string to be stripped of wikitext for use in a Section anchor
Returns:
Filtered text string

Definition at line 4726 of file Parser.php.

References $text, StringUtils::delimiterReplace(), and wfUrlProtocols().

Parser::testPreprocess ( text,
title,
options 
)

Definition at line 4773 of file Parser.php.

References $text, and Title::newFromText().

Parser::testPst ( text,
title,
options 
)

Definition at line 4765 of file Parser.php.

References $text, $wgUser, and Title::newFromText().

Parser::testSrvus ( text,
title,
options,
outputType = self::OT_HTML 
)

strip/replaceVariables/unstrip for preprocessor regression testing

Definition at line 4751 of file Parser.php.

References $text, Title::newFromText(), and Sanitizer::removeHTMLtags().

static Parser::tidy ( text  )  [static]

Interface with html tidy.

Deprecated:
Use MWTidy::tidy()

Definition at line 656 of file Parser.php.

Referenced by parse().

Parser::Title ( x = NULL  ) 

#@-

#@+ Accessor/mutator

Definition at line 4455 of file Parser.php.

References wfSetVar().

Parser::transformMsg ( text,
options 
)

Wrapper for preprocess().

Parameters:
string $text the text to preprocess
ParserOptions $options options
Returns:
string

Definition at line 3925 of file Parser.php.

References $text, $wgTitle, wfProfileIn(), and wfProfileOut().

Parser::uniqPrefix (  ) 

Accessor for mUniqPrefix.

Access:
public

Definition at line 275 of file Parser.php.

Parser::unserialiseHalfParsedText ( data,
intPrefix = null 
)

Definition at line 4865 of file Parser.php.

References $key, $ns, and $text.

Parser::unstrip ( text,
state 
) [private]

Restores pre, math, and other extensions removed by strip().

always call unstripNoWiki() after this one

Deprecated:
use $this->mStripState->unstrip()

Definition at line 617 of file Parser.php.

Parser::unstripForHTML ( text  ) 

Deprecated:
use $this->mStripState->unstripBoth()

Definition at line 634 of file Parser.php.

Parser::unstripNoWiki ( text,
state 
) [private]

Always call this after unstrip() to preserve the order.

Deprecated:
use $this->mStripState->unstrip()

Definition at line 627 of file Parser.php.

Parser::validateSig ( text  ) 

Check that the user's signature contains no bad XML.

Parameters:
string $text
Returns:
mixed An expanded string, or false if invalid.

Definition at line 3846 of file Parser.php.

References $text, and Xml::isWellFormedXmlFragment().


Member Data Documentation

Parser::$mArgStack

Definition at line 100 of file Parser.php.

Parser::$mAutonumber

Definition at line 99 of file Parser.php.

Parser::$mConf

Definition at line 93 of file Parser.php.

Parser::$mDefaultSort

Definition at line 102 of file Parser.php.

Parser::$mDefaultStripList

Definition at line 93 of file Parser.php.

Parser::$mDoubleUnderscores

Definition at line 104 of file Parser.php.

Parser::$mDTopen

Definition at line 99 of file Parser.php.

Parser::$mExpensiveFunctionCount

Definition at line 105 of file Parser.php.

Parser::$mExtLinkBracketedRegex

Definition at line 93 of file Parser.php.

Parser::$mFileCache

Definition at line 106 of file Parser.php.

Parser::$mFunctionHooks

Definition at line 93 of file Parser.php.

Parser::$mFunctionSynonyms

Definition at line 93 of file Parser.php.

Parser::$mHeadings

Definition at line 104 of file Parser.php.

Parser::$mImageParams

Definition at line 93 of file Parser.php.

Parser::$mImageParamsMagicArray

Definition at line 93 of file Parser.php.

Parser::$mIncludeCount

Definition at line 100 of file Parser.php.

Parser::$mIncludeSizes

Definition at line 102 of file Parser.php.

Parser::$mInPre

Definition at line 100 of file Parser.php.

Parser::$mLastSection

Definition at line 100 of file Parser.php.

Parser::$mLinkHolders

Definition at line 101 of file Parser.php.

Parser::$mLinkID

Definition at line 101 of file Parser.php.

Parser::$mMarkerIndex

Definition at line 93 of file Parser.php.

Parser::$mOptions

Definition at line 110 of file Parser.php.

Parser::$mOutput

Definition at line 99 of file Parser.php.

Parser::$mOutputType

Definition at line 110 of file Parser.php.

Parser::$mPPNodeCount

Definition at line 102 of file Parser.php.

Parser::$mPreprocessor

Definition at line 93 of file Parser.php.

Parser::$mRevIdForTs

Definition at line 110 of file Parser.php.

Parser::$mRevisionId

Definition at line 110 of file Parser.php.

Parser::$mRevisionTimestamp

Definition at line 110 of file Parser.php.

Parser::$mStripList

Definition at line 93 of file Parser.php.

Parser::$mStripState

Definition at line 99 of file Parser.php.

Parser::$mTagHooks

#@+

Access:
private

Definition at line 93 of file Parser.php.

Parser::$mTitle

Definition at line 110 of file Parser.php.

Parser::$mTplDomCache

Definition at line 104 of file Parser.php.

Parser::$mTplExpandCache

Definition at line 103 of file Parser.php.

Parser::$mTplRedirCache

Definition at line 104 of file Parser.php.

Parser::$mTransparentTagHooks

Definition at line 93 of file Parser.php.

Parser::$mUrlProtocols

Definition at line 93 of file Parser.php.

Parser::$mVarCache

Definition at line 93 of file Parser.php.

Parser::$mVariables

Definition at line 93 of file Parser.php.

Parser::$ot

Definition at line 110 of file Parser.php.

Referenced by setOutputType().

Definition at line 70 of file Parser.php.

Definition at line 72 of file Parser.php.

Definition at line 73 of file Parser.php.

Definition at line 74 of file Parser.php.

Definition at line 68 of file Parser.php.

Definition at line 71 of file Parser.php.

Definition at line 69 of file Parser.php.

Definition at line 67 of file Parser.php.

Initial value:

 '/^(http:\/\/|https:\/\/)([^][<>"\\x00-\\x20\\x7F]+)
                \\/([A-Za-z0-9_.,~%\\-+&;#*?!=()@\\x80-\\xFF]+)\\.((?i)gif|png|jpg|jpeg)$/Sx'

Reimplemented in Parser_LinkHooks.

Definition at line 63 of file Parser.php.

const Parser::EXT_LINK_URL_CLASS = '[^][<>"\\x00-\\x20\\x7F]'

Reimplemented in Parser_LinkHooks.

Definition at line 62 of file Parser.php.

const Parser::MARKER_SUFFIX = "-QINU\x7f"

Definition at line 87 of file Parser.php.

Referenced by PPFrame_Hash::expand(), and PPFrame_DOM::expand().

const Parser::OT_HTML = 1

Definition at line 81 of file Parser.php.

const Parser::OT_MSG = 3

Definition at line 84 of file Parser.php.

Definition at line 83 of file Parser.php.

const Parser::OT_WIKI = 2

Definition at line 82 of file Parser.php.

Definition at line 57 of file Parser.php.

Definition at line 58 of file Parser.php.

const Parser::VERSION = '1.6.4'

Update this version number when the ParserOutput format changes in an incompatible way, so the parser cache can automatically discard old data.

Reimplemented in Parser_LinkHooks.

Definition at line 53 of file Parser.php.

Referenced by ParserOutput::expired().


The documentation for this class was generated from the following file:

Generated on Sat Sep 5 02:08:44 2009 for MediaWiki by  doxygen 1.5.9