MediaWiki  1.30.2
StripState Class Reference

Public Member Functions

 __construct ( $prefix=null)
 
 addGeneral ( $marker, $value)
 
 addNoWiki ( $marker, $value)
 Add a nowiki strip item. More...
 
 getSubState ( $text)
 Get a StripState object which is sufficient to unstrip the given text. More...
 
 killMarkers ( $text)
 Remove any strip markers found in the given text. More...
 
 merge ( $otherState, $texts)
 Merge another StripState object into this one. More...
 
 unstripBoth ( $text)
 
 unstripGeneral ( $text)
 
 unstripNoWiki ( $text)
 

Public Attributes

 $tempMergePrefix
 
const UNSTRIP_RECURSION_LIMIT = 20
 

Protected Member Functions

 addItem ( $type, $marker, $value)
 
 mergeCallback ( $m)
 
 unstripCallback ( $m)
 
 unstripType ( $type, $text)
 

Protected Attributes

 $circularRefGuard
 
 $data
 
 $prefix
 
 $recursionLevel = 0
 
 $regex
 
 $tempType
 

Detailed Description

Todo:
document, briefly.

Definition at line 28 of file StripState.php.

Constructor & Destructor Documentation

◆ __construct()

StripState::__construct (   $prefix = null)
Parameters
string | null$prefix
Since
1.26 The prefix argument should be omitted, as the strip marker prefix string is now a constant.

Definition at line 44 of file StripState.php.

References $prefix, data, and wfDeprecated().

Member Function Documentation

◆ addGeneral()

StripState::addGeneral (   $marker,
  $value 
)
Parameters
string$marker
string$value

Definition at line 70 of file StripState.php.

References $value, and addItem().

◆ addItem()

StripState::addItem (   $type,
  $marker,
  $value 
)
protected
Exceptions
MWException
Parameters
string$type
string$marker
string$value

Definition at line 80 of file StripState.php.

References $type, $value, and data.

Referenced by addGeneral(), and addNoWiki().

◆ addNoWiki()

StripState::addNoWiki (   $marker,
  $value 
)

Add a nowiki strip item.

Parameters
string$marker
string$value

Definition at line 62 of file StripState.php.

References $value, and addItem().

◆ getSubState()

StripState::getSubState (   $text)

Get a StripState object which is sufficient to unstrip the given text.

It will contain the minimum subset of strip items necessary.

Parameters
string$text
Returns
StripState

Definition at line 173 of file StripState.php.

References data.

◆ killMarkers()

StripState::killMarkers (   $text)

Remove any strip markers found in the given text.

Parameters
string$textInput string
Returns
string

Definition at line 239 of file StripState.php.

◆ merge()

StripState::merge (   $otherState,
  $texts 
)

Merge another StripState object into this one.

The strip marker keys will not be preserved. The strings in the $texts array will have their strip markers rewritten, the resulting array of strings will be returned.

Parameters
StripState$otherState
array$texts
Returns
array

Definition at line 209 of file StripState.php.

References $type, $value, as, data, and wfRandomString().

◆ mergeCallback()

StripState::mergeCallback (   $m)
protected
Parameters
array$m
Returns
string

Definition at line 228 of file StripState.php.

◆ unstripBoth()

StripState::unstripBoth (   $text)
Parameters
string$text
Returns
mixed

Definition at line 108 of file StripState.php.

References unstripType().

◆ unstripCallback()

StripState::unstripCallback (   $m)
protected
Parameters
array$m
Returns
array

Definition at line 136 of file StripState.php.

References $ret, $tempType, $value, data, unstripType(), and wfMessage().

◆ unstripGeneral()

StripState::unstripGeneral (   $text)
Parameters
string$text
Returns
mixed

Definition at line 92 of file StripState.php.

References unstripType().

◆ unstripNoWiki()

StripState::unstripNoWiki (   $text)
Parameters
string$text
Returns
mixed

Definition at line 100 of file StripState.php.

References unstripType().

◆ unstripType()

StripState::unstripType (   $type,
  $text 
)
protected
Parameters
string$type
string$text
Returns
mixed

Definition at line 119 of file StripState.php.

References $tempType, $type, captcha-old\count, and data.

Referenced by unstripBoth(), unstripCallback(), unstripGeneral(), and unstripNoWiki().

Member Data Documentation

◆ $circularRefGuard

StripState::$circularRefGuard
protected

Definition at line 34 of file StripState.php.

◆ $data

StripState::$data
protected

Definition at line 30 of file StripState.php.

◆ $prefix

StripState::$prefix
protected

Definition at line 29 of file StripState.php.

Referenced by __construct().

◆ $recursionLevel

StripState::$recursionLevel = 0
protected

Definition at line 35 of file StripState.php.

◆ $regex

StripState::$regex
protected

Definition at line 31 of file StripState.php.

◆ $tempMergePrefix

StripState::$tempMergePrefix

Definition at line 33 of file StripState.php.

◆ $tempType

StripState::$tempType
protected

Definition at line 33 of file StripState.php.

Referenced by unstripCallback(), and unstripType().

◆ UNSTRIP_RECURSION_LIMIT

const StripState::UNSTRIP_RECURSION_LIMIT = 20

Definition at line 37 of file StripState.php.


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