autoLinkBbCode()
autoLinkPlainText()
bbCodeStrip()
buildCensorArray()
censorString()
censorStringTemplateHelper()
getLinkClassTarget()
highlightSearchTerm()
prepareAutoLinkedUrl()
stripQuotes()
wholeWordTrim()
wholeWordTrimAroundSearchTerm()
wordWrapString()
_autoLinkPlainTextCallback()
__construct()
$_alptHtmlEncoded
$_censorCache
Helper to do common string operations, such as word wrap and censoring.
package | XenForo_Helper |
---|
autoLinkBbCode(string $string) : string
Output will be original BB code input with [url] or [email] tags inserted where ncessary.
string
BB code string
string
autoLinkPlainText(string $string, boolean $htmlEncoded) : string
This text should generally already be HTML escaped, because it can't be done after the linking.
string
boolean
Denotes whether the text is already encoded; if false, the URL will be encoded before being put into the link
string
Text with links addedbbCodeStrip(string $string, boolean $stripQuote) : string
string
boolean
If true, contents from within quote tags are stripped
string
buildCensorArray(array $words, string $censorString) : array
array
List of words (from option format)
string
String to replace each character with if no replacement map
array
Possible keys: exact, any with key-value search/replace pairscensorString(string $string, array $words, string | null $censorString) : string
string
array
null
Words to censor. Null to use option value.
string
null
String to censor each character with. Null to use option value.
string
censorStringTemplateHelper(string $string, string $censorString) : string
string
string
string
getLinkClassTarget(string $url) : array
string
array
[class, target, type (internal/external)]highlightSearchTerm(string $string, string $term, string $emClass) : string
..
string
Haystack
string
Needle
string
Class with which to style the wrapping
string
HTMLprepareAutoLinkedUrl(string $url) : array
string
URL that may have trailing characters or missing scheme
array
Keys: url, linkText, suffixTextstripQuotes(string $string, integer $allowedDepth, boolean $censorResults) : string
string
integer
-1 for unlimited depth
boolean
string
Quotes strippedwholeWordTrim($string, integer $maxLength, integer $offset, string $elipses) : string
string
integer
Max length of returned string, excluding elipsis
integer
Offset from string start - will add leading elipsis
string
Elipses string (default: '...')
string
wholeWordTrimAroundSearchTerm($string, $maxLength, $term) : string
If the term is not found, the snippet is taken from the string start.
string
wordWrapString(string $string, integer $breakLength) : string
string
integer
Number of characters before break; if null, use option
string
_autoLinkPlainTextCallback(array $match) : string
array
string
__construct()
Use statically.
$_alptHtmlEncoded : boolean
Only used to pass to callback.
$_censorCache : array | null