Class to "clean up" text for various uses
Singleton
Methods | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
public
|
__construct()
Constructor of this class
Constructor of this class Gets allowed html tags from admin config settings
|
# | ||||||||||
public
|
loadConfig(string $name = null): array|string
Enter description here...
Enter description here... |
# | ||||||||||
public
|
mergeConfig(array $config_default, array $config_custom): mixed
Enter description here...
Enter description here... |
# | ||||||||||
public
static
|
getInstance(): MyTextSanitizer
Access the only instance of this class
Access the only instance of this class |
# | ||||||||||
public
|
getSmileys(bool $isAll = true): array
Get the smileys
Get the smileys Parameters
|
# | ||||||||||
public
|
smiley(string $message): string
Replace emoticons in the message with smiley images
Replace emoticons in the message with smiley images |
# | ||||||||||
protected
|
makeClickableCallbackEmailAddress(array $match): string
Callback to process email address match
Callback to process email address match Parameters
|
# | ||||||||||
public
|
makeClickable(string $text): string
Make links in the text clickable
Presently handles email addresses and http, https, ftp and sftp urls
(Note: at this…
Make links in the text clickable Presently handles email addresses and http, https, ftp and sftp urls (Note: at this time, major browsers no longer directly handle ftp/sftp urls.) |
# | ||||||||||
public
|
truncate(mixed $text): mixed|string
MyTextSanitizer::truncate()
MyTextSanitizer::truncate() |
# | ||||||||||
public
&
|
xoopsCodeDecode(string &$text, bool|int $allowimage = 1): string
Replace XoopsCodes with their equivalent HTML formatting
Replace XoopsCodes with their equivalent HTML formatting Parameters
|
# | ||||||||||
public
|
quoteConv(string $text): string
Convert quote tags
Convert quote tags |
# | ||||||||||
public
|
filterXss($text): mixed
A quick solution for filtering XSS scripts
A quick solution for filtering XSS scripts |
# | ||||||||||
public
|
nl2Br(string $text): string
Convert linebreaks to <br> tags
Convert linebreaks to |
# | ||||||||||
public
|
addSlashes(string $text): string
Add slashes to the text if magic_quotes_gpc is turned off.
Add slashes to the text if magic_quotes_gpc is turned off. |
# | ||||||||||
public
|
htmlSpecialChars(string $text, int|null $quote_style = null, string $charset = null, bool $double_encode = true): string
Convert special characters to HTML entities
Convert special characters to HTML entities Parameters
|
# | ||||||||||
public
|
undoHtmlSpecialChars(string $text): string
Reverses {@link htmlSpecialChars()}
Reverses {@link htmlSpecialChars()} |
# | ||||||||||
public
&
|
displayTarea(
string $text,
bool|int $html = 0,
bool|int $smiley = 1,
bool|int $xcode = 1,
bool|int $image = 1,
bool|int $br = 1,
): string
Filters textarea form data in DB for display
Filters textarea form data in DB for display Parameters
|
# | ||||||||||
public
&
|
previewTarea(
string $text,
bool|int $html = 0,
bool|int $smiley = 1,
bool|int $xcode = 1,
bool|int $image = 1,
bool|int $br = 1,
): string
Filters textarea form data submitted for preview
Filters textarea form data submitted for preview Parameters
|
# | ||||||||||
public
&
|
censorString(string &$text): string
Replaces banned words in a string with their replacements
Replaces banned words in a string with their replacements |
# | ||||||||||
public
|
codePreConv(mixed $text, mixed $xcode = 1): mixed
MyTextSanitizer::codePreConv()
MyTextSanitizer::codePreConv() |
# | ||||||||||
public
|
codeConvCallback($match): string
|
# | ||||||||||
public
|
codeConv(mixed $text, mixed $xcode = 1): mixed
MyTextSanitizer::codeConv()
MyTextSanitizer::codeConv() |
# | ||||||||||
public
|
executeExtensions(): bool
MyTextSanitizer::executeExtensions()
MyTextSanitizer::executeExtensions() |
# | ||||||||||
public
|
loadExtension(mixed $name): MyTextSanitizerExtension|false
MyTextSanitizer::loadExtension()
MyTextSanitizer::loadExtension() |
# | ||||||||||
public
|
executeExtension(mixed $name): mixed
MyTextSanitizer::executeExtension()
MyTextSanitizer::executeExtension() |
# | ||||||||||
public
|
textFilter(string $text, bool $force = false): string
Filter out possible malicious text
kses project at SF could be a good solution to check
Filter out possible malicious text kses project at SF could be a good solution to check Parameters
Returnsfiltered text |
# | ||||||||||
public
|
stripSlashesGPC(string $text): string
if magic_quotes_gpc is on, strip back slashes
if magic_quotes_gpc is on, strip back slashes Deprecatedas of XOOPS 2.5.11 and will be removed in next XOOPS version |
# | ||||||||||
public
|
codeSanitizer(mixed $str, mixed $image = 1): mixed|string
MyTextSanitizer::codeSanitizer()
MyTextSanitizer::codeSanitizer() Deprecatedwill be removed in next XOOPS version |
# | ||||||||||
public
|
sanitizeForDisplay(mixed $text, integer $allowhtml = 0, integer $smiley = 1, mixed $bbcode = 1): mixed|string
MyTextSanitizer::sanitizeForDisplay()
MyTextSanitizer::sanitizeForDisplay() Deprecatedwill be removed in next XOOPS version |
# | ||||||||||
public
|
sanitizeForPreview(mixed $text, integer $allowhtml = 0, integer $smiley = 1, mixed $bbcode = 1): mixed|string
MyTextSanitizer::sanitizeForPreview()
MyTextSanitizer::sanitizeForPreview() Deprecatedwill be removed in next XOOPS version |
# | ||||||||||
public
|
makeTboxData4Save(mixed $text): string
MyTextSanitizer::makeTboxData4Save()
MyTextSanitizer::makeTboxData4Save() Deprecatedwill be removed in next XOOPS version |
# | ||||||||||
public
|
makeTboxData4Show(mixed $text, mixed $smiley = 0): mixed|string
MyTextSanitizer::makeTboxData4Show()
MyTextSanitizer::makeTboxData4Show() Deprecatedwill be removed in next XOOPS version |
# | ||||||||||
public
|
makeTboxData4Edit(mixed $text): string
MyTextSanitizer::makeTboxData4Edit()
MyTextSanitizer::makeTboxData4Edit() Deprecatedwill be removed in next XOOPS version |
# | ||||||||||
public
|
makeTboxData4Preview(mixed $text, mixed $smiley = 0): mixed|string
MyTextSanitizer::makeTboxData4Preview()
MyTextSanitizer::makeTboxData4Preview() Deprecatedwill be removed in next XOOPS version |
# | ||||||||||
public
|
makeTboxData4PreviewInForm(mixed $text): string
MyTextSanitizer::makeTboxData4PreviewInForm()
MyTextSanitizer::makeTboxData4PreviewInForm() Deprecatedwill be removed in next XOOPS version |
# | ||||||||||
public
|
makeTareaData4Save(mixed $text): string
MyTextSanitizer::makeTareaData4Save()
MyTextSanitizer::makeTareaData4Save() Deprecatedwill be removed in next XOOPS version |
# | ||||||||||
public
&
|
makeTareaData4Show(mixed &$text, integer $html = 1, integer $smiley = 1, mixed $xcode = 1): mixed|string
MyTextSanitizer::makeTareaData4Show()
MyTextSanitizer::makeTareaData4Show() Deprecatedwill be removed in next XOOPS version |
# | ||||||||||
public
|
makeTareaData4Edit(mixed $text): string
MyTextSanitizer::makeTareaData4Edit()
MyTextSanitizer::makeTareaData4Edit() Deprecatedwill be removed in next XOOPS version |
# | ||||||||||
public
&
|
makeTareaData4Preview(mixed &$text, integer $html = 1, integer $smiley = 1, mixed $xcode = 1): mixed|string
MyTextSanitizer::makeTareaData4Preview()
MyTextSanitizer::makeTareaData4Preview() Deprecatedwill be removed in next XOOPS version |
# | ||||||||||
public
|
makeTareaData4PreviewInForm(mixed $text): string
MyTextSanitizer::makeTareaData4PreviewInForm()
MyTextSanitizer::makeTareaData4PreviewInForm() Deprecatedwill be removed in next XOOPS version |
# | ||||||||||
public
|
makeTareaData4InsideQuotes(mixed $text): string
MyTextSanitizer::makeTareaData4InsideQuotes()
MyTextSanitizer::makeTareaData4InsideQuotes() Deprecatedwill be removed in next XOOPS version |
# | ||||||||||
public
|
oopsStripSlashesGPC(mixed $text): string
MyTextSanitizer::oopsStripSlashesGPC()
MyTextSanitizer::oopsStripSlashesGPC() Deprecatedwill be removed in next XOOPS version |
# | ||||||||||
public
|
oopsStripSlashesRT(mixed $text): mixed|string
MyTextSanitizer::oopsStripSlashesRT()
MyTextSanitizer::oopsStripSlashesRT() Deprecatedwill be removed in next XOOPS version |
# | ||||||||||
public
|
oopsAddSlashes(mixed $text): string
MyTextSanitizer::oopsAddSlashes()
MyTextSanitizer::oopsAddSlashes() Deprecatedwill be removed in next XOOPS version |
# | ||||||||||
public
|
oopsHtmlSpecialChars(mixed $text): string
MyTextSanitizer::oopsHtmlSpecialChars()
MyTextSanitizer::oopsHtmlSpecialChars() Deprecatedwill be removed in next XOOPS version |
# | ||||||||||
public
|
oopsNl2Br(mixed $text): string
MyTextSanitizer::oopsNl2Br()
MyTextSanitizer::oopsNl2Br() Deprecatedwill be removed in next XOOPS version |
# |
Properties | |||
---|---|---|---|
public
|
array
|
$smileys = []
|
# |
public
|
|
$censorConf
|
# |
public
|
string
|
$text = ''
holding reference to text
holding reference to text |
# |
public
|
|
$patterns = []
|
# |
public
|
|
$replacements = []
|
# |
public
|
|
$callbackPatterns = []
|
# |
public
|
|
$callbacks = []
|
# |
public
|
|
$path_basic
|
# |
public
|
|
$path_config
|
# |
public
|
|
$path_plugin
|
# |
public
|
|
$config
|
# |