Property | Type | Description | |
---|---|---|---|
$DisplayNoFollow | Flag which allows plugins to decide if the output should include rel="nofollow" on any links. | ||
$FormatLinks | Whether or not to replace plain text links with anchors. | ||
$MentionsUrlFormat | string |
Property | Type | Description | |
---|---|---|---|
$SanitizedFormats | array | ||
$_CleanChars | Unicode to ascii conversion table. | ||
$_UrlTranslations | array |
Method | Description | |
---|---|---|
activityHeadline ( object $Activity, integer $ProfileUserID = '', $ViewingUserID = '' ) : string | The ActivityType table has some special sprintf search/replace values in the FullHeadline and ProfileHeadline fields. | |
alphaNumeric ( string $Mixed ) : string | Removes all non-alpha-numeric characters (except for _ and -) from | |
arrayAsAttributes ( array $Array ) : string | ||
arrayAsObject ( array $Array ) : stdClass | Takes an object and convert's it's properties => values to an associative array of $Array[Property] => Value sets. | |
arrayValueForPhp ( $String ) : string | Formats a string so that it can be saved to a PHP file in double-quotes of an array value assignment. | |
auto ( mixed $Mixed ) : string | Takes a mixed variable, filters unsafe things, renders BBCode and returns it. | |
bbCode ( mixed $Mixed ) : string | Takes a mixed variable. | |
bigNumber ( mixed $Number, $Format = '' ) : string | Format a number by putting K/M/B suffix after it when appropriate. | |
bytes ( integer $Bytes, integer $Precision = 2 ) : string | Format a number as if it's a number of bytes by adding the appropriate B/K/M/G/T suffix. | |
clean ( mixed $Mixed ) : string | Convert certain unicode characters into their ascii equivalents. | |
date ( string $Timestamp = '', string $Format = '' ) : string | Formats a Mysql DateTime string in the specified format. | |
dateFull ( integer $Timestamp, string $Format = '' ) | Formats a MySql datetime or a unix timestamp for display in the system. | |
defaultFormat ( boolean | null $is_mobile = null ) : string | Return the default input formatter. | |
deleted ( mixed $Mixed ) : string | Format a string from of "Deleted" content (comment, message, etc). | |
display ( mixed $Mixed ) : string | Takes a mixed variable, formats it for display on the screen, and returns it. | |
email ( string $Email ) : string | Formats an email address in a non-scrapable format. | |
form ( mixed $Mixed ) : string | Takes a mixed variable, formats it for display in a form, and returns it. | |
fuzzyTime ( $Timestamp = null, $MorePrecise = false ) : string | Show times relative to now, e.g. "4 hours ago". | |
getEmbedSize ( ) : array | Returns embedded video width and height, based on configuration. | |
html ( mixed $Mixed ) : string | Takes a mixed variable, filters unsafe HTML and returns it. | |
htmlFilter ( mixed $Mixed ) : string | Takes a mixed variable, filters unsafe HTML and returns it. | |
image ( string $Body ) : string | Format an encoded string of image properties as HTML. | |
links ( mixed $Mixed ) : string | Formats the anchor tags around the links in text. | |
markdown ( mixed $Mixed, boolean $Flavored = true ) : string | Format a string using Markdown syntax. Also purifies the output HTML. | |
mentions ( $Mixed ) : mixed | string | Handle mentions formatting. | |
objectAsArray ( object $Object ) : unknown | Takes an object and converts its properties => values to an associative array of $Array[Property] => Value sets. | |
plainText ( string $Body, string $Format = 'Html' ) : string | Format a string as plain text. | |
raw ( string | object | array $Mixed ) : string | Return the input without any operations performed at all. | |
reduceWhiteSpaces ( string $String ) | Reduces multiple whitespaces including line breaks and tabs to one single space character. | |
replaceButProtectCodeBlocks ( mixed $Search, mixed $Replace, mixed $Subject, boolean $IsCallback = false ) : string |
Do a preg_replace, but don't affect things inside tags. |
|
rssHtml ( string $Text, string $Format = 'Html' ) : string | Format some text in a way suitable for passing into an rss/atom feed. | |
seconds ( integer $Seconds ) : string | Formats seconds in a human-readable way (ie. 45 seconds, 15 minutes, 2 hours, 4 days, 2 months, etc). | |
serialize ( mixed $Mixed ) : string | Takes any variable and serializes it. | |
spoilerHtml ( string $spoilerText ) : string | Returns spoiler text wrapped in a HTML spoiler wrapper. | |
tagContent ( string $html, callable $callback, boolean $skipAnchors = true, boolean $skipCode = true ) : string | Executes the callback function on parts of the string excluding html tags. | |
text ( mixed $mixed, $addBreaks = true ) : string | Takes a mixed variable, formats it for display on the screen as plain text. | |
textEx ( string $Str ) : string | Process as plain text + our magic formatting. | |
timespan ( integer $timespan ) : string | ||
to ( mixed $Mixed, string $FormatMethod ) : mixed | Takes a mixed variable, formats it in the specified format type, and returns it. | |
toDate ( integer $Timestamp = '' ) : string | Format a timestamp or the current time to go into the database. | |
toDateTime ( integer $Timestamp = '' ) : string | Format a timestamp or the current time to go into the database. | |
toTimestamp ( string $DateTime = '' ) : string | boolean | Convert a datetime to a timestamp. | |
toTimezone ( integer $Timestamp ) : integer | Formats a timestamp to the current user's timezone. | |
unembedContent ( mixed $Mixed ) : HTML | Strips out embed/iframes we support and replaces with placeholder. | |
unserialize ( string $SerializedString ) : mixed | Takes a serialized variable and unserializes it back into its original state. | |
url ( mixed $Mixed ) : string | Creates URL codes containing only lowercase Roman letters, digits, and hyphens. | |
vanillaSprintf ( $PlaceholderString, $ReplaceWith ) : mixed | ||
wysiwyg ( $Mixed ) : mixed | string | Format text from WYSIWYG editor input. |
Method | Description | |
---|---|---|
formatMentionsCallback ( string $str ) : string | Adds a link to all mentions in a given string. | |
isHtml ( $Text ) : boolean | Detect HTML for the purposes of doing advanced filtering. | |
legacySpoilers ( string $html ) : string | Spoilers with backwards compatibility. | |
linksCallback ( array $Matches ) : string | Transform match to clickable links or to embedded equivalent. | |
listCallback ( array $Matches ) : string | Formats BBCode list items. | |
processHTML ( $html ) : string | Performs replacing operations on a HTML string. Usually for formatting posts. | |
replaceListItems ( string $html ) : string | Replaces opening html list tags with an asterisk and closing list tags with new lines. | |
replaceSpoilers ( string $html, string $replaceWith = '(Spoiler)' ) : string | Check to see if a string has spoilers and replace them with an innocuous string. | |
vanillaSprintfCallback ( $Match, boolean $InternalReplacementList = false ) : mixed |
public static activityHeadline ( object $Activity, integer $ProfileUserID = '', $ViewingUserID = '' ) : string | ||
$Activity | object | An object representation of the activity being formatted. |
$ProfileUserID | integer | If looking at a user profile, this is the UserID of the profile we are looking at. |
return | string |
public static alphaNumeric ( string $Mixed ) : string | ||
$Mixed | string | An object, array, or string to be formatted. |
return | string |
public static arrayAsAttributes ( array $Array ) : string | ||
$Array | array | |
return | string |
public static arrayAsObject ( array $Array ) : stdClass | ||
$Array | array | An array to be converted to object. |
return | stdClass |
public static arrayValueForPhp ( $String ) : string | ||
return | string |
protected static formatMentionsCallback ( string $str ) : string | ||
$str | string | The html-formatted string to format mentions in. |
return | string | The formatted string. |
public static getEmbedSize ( ) : array | ||
return | array | array(Width, Height) |
public static htmlFilter ( mixed $Mixed ) : string | ||
$Mixed | mixed | An object, array, or string to be formatted. |
return | string | HTML |
protected static legacySpoilers ( string $html ) : string | ||
$html | string | |
return | string |
protected static linksCallback ( array $Matches ) : string | ||
$Matches | array | Captured and grouped matches against string. |
return | string |
protected static listCallback ( array $Matches ) : string | ||
$Matches | array | |
return | string |
public static objectAsArray ( object $Object ) : unknown | ||
$Object | object | The object to be converted to an array. |
return | unknown |
protected static processHTML ( $html ) : string | ||
$html | An unparsed HTML string. | |
return | string | The formatted HTML string. |
public static reduceWhiteSpaces ( string $String ) | ||
$String | string | The string which should be optimized |
public static replaceButProtectCodeBlocks ( mixed $Search, mixed $Replace, mixed $Subject, boolean $IsCallback = false ) : string | ||
$Search | mixed | The value being searched for, just like in preg_replace or preg_replace_callback. |
$Replace | mixed | The replacement value, just like in preg_replace or preg_replace_callback. |
$Subject | mixed | The string being searched. |
$IsCallback | boolean | If true, do preg_replace_callback. Do preg_replace otherwise. |
return | string |
protected static replaceListItems ( string $html ) : string | ||
$html | string | An HTML-formatted string. |
return | string | Returns the html with all list items removed. |
public static spoilerHtml ( string $spoilerText ) : string | ||
$spoilerText | string | The inner text of the spoiler. |
return | string |
.
public static tagContent ( string $html, callable $callback, boolean $skipAnchors = true, boolean $skipCode = true ) : string
$html
string
The html-formatted string to parse.
$callback
callable
The callback function to execute on appropriate segments of the string.
$skipAnchors
boolean
Whether to call the callback function on anchor tag content.
$skipCode
boolean
Whether to call the callback function on code tag content.
return
string
Process as plain text + our magic formatting.
Takes a mixed variable, formats it in the specified format type, and returns it.
Format a timestamp or the current time to go into the database.
Format a timestamp or the current time to go into the database.
public static toDateTime ( integer $Timestamp = '' ) : string
$Timestamp
integer
return
string
The formatted date and time.
Convert a datetime to a timestamp.
Formats a timestamp to the current user's timezone.
public static toTimezone ( integer $Timestamp ) : integer
$Timestamp
integer
The timestamp in gmt.
return
integer
The timestamp according to the user's timezone.
This allows later parsing to insert a sanitized video video embed normally.
Necessary for backwards compatibility from when we allowed embed & object tags.
This is not an HTML filter; it enables old YouTube videos to theoretically work,
it doesn't effectively block YouTube iframes or objects.
public static unembedContent ( mixed $Mixed ) : HTML
$Mixed
mixed
return
HTML
string
Takes a serialized variable and unserializes it back into its original state.
public static unserialize ( string $SerializedString ) : mixed
$SerializedString
string
A json or php serialized string to be unserialized.
return
mixed
Creates URL codes containing only lowercase Roman letters, digits, and hyphens.
public static vanillaSprintf ( $PlaceholderString, $ReplaceWith ) : mixed
$PlaceholderString
$ReplaceWith
return
mixed
protected static vanillaSprintfCallback ( $Match, boolean $InternalReplacementList = false ) : mixed
$Match
$InternalReplacementList
boolean
return
mixed
Format text from WYSIWYG editor input.
Property Details
Flag which allows plugins to decide if the output should include rel="nofollow" on any links.
public static $DisplayNoFollow
public static string $MentionsUrlFormat
return
string
protected static array $SanitizedFormats
return
array
Unicode to ascii conversion table.
protected static $_CleanChars
protected static array $_UrlTranslations
return
array