XOOPS 2.5.6
Final
|
Public Member Functions | |
__construct () | |
addSlashes ($text) | |
& | censorString (&$text) |
codeConv ($text, $xcode=1) | |
codePreConv ($text, $xcode=1) | |
codeSanitizer ($str, $image=1) | |
& | displayTarea ($text, $html=0, $smiley=1, $xcode=1, $image=1, $br=1) |
executeExtension ($name) | |
executeExtensions () | |
filterXss ($text) | |
getSmileys ($isAll=true) | |
htmlSpecialChars ($text, $quote_style=ENT_QUOTES, $charset=null, $double_encode=true) | |
loadConfig ($name=null) | |
loadExtension ($name) | |
makeClickable (&$text) | |
makeTareaData4Edit ($text) | |
makeTareaData4InsideQuotes ($text) | |
& | makeTareaData4Preview (&$text, $html=1, $smiley=1, $xcode=1) |
makeTareaData4PreviewInForm ($text) | |
makeTareaData4Save ($text) | |
& | makeTareaData4Show (&$text, $html=1, $smiley=1, $xcode=1) |
makeTboxData4Edit ($text) | |
makeTboxData4Preview ($text, $smiley=0) | |
makeTboxData4PreviewInForm ($text) | |
makeTboxData4Save ($text) | |
makeTboxData4Show ($text, $smiley=0) | |
mergeConfig ($config_default, $config_custom) | |
MyTextSanitizer () | |
nl2Br ($text) | |
oopsAddSlashes ($text) | |
oopsHtmlSpecialChars ($text) | |
oopsNl2Br ($text) | |
oopsStripSlashesGPC ($text) | |
oopsStripSlashesRT ($text) | |
& | previewTarea ($text, $html=0, $smiley=1, $xcode=1, $image=1, $br=1) |
quoteConv ($text) | |
sanitizeForDisplay ($text, $allowhtml=0, $smiley=1, $bbcode=1) | |
sanitizeForPreview ($text, $allowhtml=0, $smiley=1, $bbcode=1) | |
smiley ($message) | |
stripSlashesGPC ($text) | |
textFilter ($text, $force=false) | |
truncate ($text) | |
undoHtmlSpecialChars ($text) | |
& | xoopsCodeDecode (&$text, $allowimage=1) |
Static Public Member Functions | |
static | getInstance () |
Public Attributes | |
$censorConf | |
$config | |
$path_basic | |
$path_plugin | |
$patterns = array() | |
$replacements = array() | |
$smileys = array() | |
$text = "" | |
Definition at line 142 of file module.textsanitizer.php.
MyTextSanitizer::__construct | ( | ) |
Definition at line 167 of file module.textsanitizer.php.
References loadConfig().
Referenced by MyTextSanitizer().
MyTextSanitizer::addSlashes | ( | $text | ) |
Add slashes to the text if magic_quotes_gpc is turned off.
string | $text |
Definition at line 451 of file module.textsanitizer.php.
References $text.
Referenced by makeTareaData4Save(), makeTboxData4Save(), and oopsAddSlashes().
& MyTextSanitizer::censorString | ( | & | $text | ) |
Replaces banned words in a string with their replacements
string | $text |
Definition at line 573 of file module.textsanitizer.php.
References $ret, $text, and executeExtension().
MyTextSanitizer::codeConv | ( | $text, | |
$xcode = 1 |
|||
) |
mixed | $text | |
mixed | $xcode |
Definition at line 606 of file module.textsanitizer.php.
References $patterns, $replacements, and $text.
Referenced by displayTarea().
MyTextSanitizer::codePreConv | ( | $text, | |
$xcode = 1 |
|||
) |
MyTextSanitizer::codePreConv()
mixed | $text | |
mixed | $xcode |
Definition at line 589 of file module.textsanitizer.php.
References $patterns, $replacements, and $text.
Referenced by displayTarea().
MyTextSanitizer::codeSanitizer | ( | $str, | |
$image = 1 |
|||
) |
*#@+
MyTextSanitizer::codeSanitizer()
mixed | $str | |
mixed | $image |
Definition at line 701 of file module.textsanitizer.php.
References $GLOBALS, $image, htmlSpecialChars(), and xoopsCodeDecode().
& MyTextSanitizer::displayTarea | ( | $text, | |
$html = 0 , |
|||
$smiley = 1 , |
|||
$xcode = 1 , |
|||
$image = 1 , |
|||
$br = 1 |
|||
) |
Filters textarea form data in DB for display
string | $text | |
bool | $html | allow html? |
bool | $smiley | allow smileys? |
bool | $xcode | allow xoopscode? |
bool | $image | allow inline images? |
bool | $br | convert linebreaks? |
Definition at line 514 of file module.textsanitizer.php.
References $html, $image, $text, _CHARSET, codeConv(), codePreConv(), filterXss(), htmlSpecialChars(), makeClickable(), nl2Br(), smiley(), and xoopsCodeDecode().
Referenced by makeTareaData4Show(), and previewTarea().
MyTextSanitizer::executeExtension | ( | $name | ) |
MyTextSanitizer::executeExtension()
mixed | $name |
Definition at line 664 of file module.textsanitizer.php.
References loadExtension().
Referenced by censorString(), executeExtensions(), and textFilter().
MyTextSanitizer::executeExtensions | ( | ) |
MyTextSanitizer::executeExtensions()
Definition at line 622 of file module.textsanitizer.php.
References executeExtension().
Referenced by xoopsCodeDecode().
MyTextSanitizer::filterXss | ( | $text | ) |
A quick solution for filtering XSS scripts
: To be improved
Definition at line 418 of file module.textsanitizer.php.
References $patterns, $replacements, and $text.
Referenced by displayTarea().
|
static |
Access the only instance of this class
object
Definition at line 236 of file module.textsanitizer.php.
References MyTextSanitizer().
Referenced by b_system_info_show(), XoopsStory\bodytext(), XoopsModelWrite\cleanVars(), XoopsObject\cleanVars(), XoopsFormDhtmlTextArea\codeIcon(), createConfigform(), XoopsBlock\getContent(), SystemBlock\getContent(), XoopsModelRead\getList(), XoopsRankHandler\getList(), XoopsTree\getNicePathFromId(), XoopsTree\getPathFromId(), XoopsTopic\getTopicsList(), XoopsUser\getUnameFromId(), XoopsUserUtility\getUnameFromId(), XoopsUserUtility\getUnameFromIds(), XoopsObject\getVar(), XoopsStory\hometext(), MyTextSanitizerExtension\loadConfig(), XoopsTree\makeMySelBox(), XoopsTopic\store(), XoopsStory\store(), XoopsStory\title(), XoopsTopic\topic_imgurl(), XoopsTopic\topic_title(), truncate(), XoopsUserUtility\validate(), xoFormField(), xoFormFieldCharset(), xoFormFieldCollation(), xoops_getrank(), xoops_header(), xoops_module_change(), xoopsSmilies(), and xoPassField().
MyTextSanitizer::getSmileys | ( | $isAll = true | ) |
Get the smileys
boole | $isAll | TRUE for all smileys, FALSE for smileys with display = 1 |
Definition at line 251 of file module.textsanitizer.php.
References $smileys, $xoopsDB, and XoopsDatabaseFactory\getDatabaseConnection().
Referenced by smiley().
MyTextSanitizer::htmlSpecialChars | ( | $text, | |
$quote_style = ENT_QUOTES , |
|||
$charset = null , |
|||
$double_encode = true |
|||
) |
Convert special characters to HTML entities
string | $text | string being converted |
int | $quote_style | |
string | $charset | character set used in conversion |
bool | $double_encode |
Definition at line 482 of file module.textsanitizer.php.
References $text, and _CHARSET.
Referenced by codeSanitizer(), displayTarea(), makeTareaData4Edit(), makeTareaData4InsideQuotes(), makeTareaData4PreviewInForm(), makeTboxData4Edit(), makeTboxData4Preview(), makeTboxData4PreviewInForm(), makeTboxData4Show(), oopsHtmlSpecialChars(), sanitizeForDisplay(), and sanitizeForPreview().
MyTextSanitizer::loadConfig | ( | $name = null | ) |
Enter description here...
string | $name |
Definition at line 195 of file module.textsanitizer.php.
References $file, MyTextSanitizerExtension\loadConfig(), and mergeConfig().
Referenced by __construct().
MyTextSanitizer::loadExtension | ( | $name | ) |
MyTextSanitizer::loadExtension()
mixed | $name |
Definition at line 639 of file module.textsanitizer.php.
References $file.
Referenced by executeExtension().
MyTextSanitizer::makeClickable | ( | & | $text | ) |
Make links in the text clickable
string | $text |
Definition at line 296 of file module.textsanitizer.php.
References $patterns, $replacements, and $text.
Referenced by displayTarea(), sanitizeForDisplay(), and sanitizeForPreview().
MyTextSanitizer::makeTareaData4Edit | ( | $text | ) |
MyTextSanitizer::makeTareaData4Edit()
mixed | $text |
Definition at line 871 of file module.textsanitizer.php.
References $GLOBALS, $text, and htmlSpecialChars().
MyTextSanitizer::makeTareaData4InsideQuotes | ( | $text | ) |
MyTextSanitizer::makeTareaData4InsideQuotes()
mixed | $text |
Definition at line 913 of file module.textsanitizer.php.
References $GLOBALS, $text, and htmlSpecialChars().
& MyTextSanitizer::makeTareaData4Preview | ( | & | $text, |
$html = 1 , |
|||
$smiley = 1 , |
|||
$xcode = 1 |
|||
) |
MyTextSanitizer::makeTareaData4Preview()
mixed | $text | |
integer | $html | |
integer | $smiley | |
mixed | $xcode |
Definition at line 886 of file module.textsanitizer.php.
References $GLOBALS, $html, $text, and previewTarea().
MyTextSanitizer::makeTareaData4PreviewInForm | ( | $text | ) |
MyTextSanitizer::makeTareaData4PreviewInForm()
mixed | $text |
Definition at line 899 of file module.textsanitizer.php.
References $GLOBALS, $text, htmlSpecialChars(), and stripSlashesGPC().
MyTextSanitizer::makeTareaData4Save | ( | $text | ) |
MyTextSanitizer::makeTareaData4Save()
mixed | $text |
Definition at line 843 of file module.textsanitizer.php.
References $GLOBALS, $text, and addSlashes().
& MyTextSanitizer::makeTareaData4Show | ( | & | $text, |
$html = 1 , |
|||
$smiley = 1 , |
|||
$xcode = 1 |
|||
) |
MyTextSanitizer::makeTareaData4Show()
mixed | $text | |
integer | $html | |
integer | $smiley | |
mixed | $xcode |
Definition at line 858 of file module.textsanitizer.php.
References $GLOBALS, $html, $text, and displayTarea().
MyTextSanitizer::makeTboxData4Edit | ( | $text | ) |
MyTextSanitizer::makeTboxData4Edit()
mixed | $text |
Definition at line 803 of file module.textsanitizer.php.
References $GLOBALS, $text, and htmlSpecialChars().
MyTextSanitizer::makeTboxData4Preview | ( | $text, | |
$smiley = 0 |
|||
) |
MyTextSanitizer::makeTboxData4Preview()
mixed | $text | |
mixed | $smiley |
Definition at line 816 of file module.textsanitizer.php.
References $GLOBALS, $text, htmlSpecialChars(), and stripSlashesGPC().
MyTextSanitizer::makeTboxData4PreviewInForm | ( | $text | ) |
MyTextSanitizer::makeTboxData4PreviewInForm()
mixed | $text |
Definition at line 830 of file module.textsanitizer.php.
References $GLOBALS, $text, htmlSpecialChars(), and stripSlashesGPC().
MyTextSanitizer::makeTboxData4Save | ( | $text | ) |
MyTextSanitizer::makeTboxData4Save()
mixed | $text |
Definition at line 776 of file module.textsanitizer.php.
References $GLOBALS, $text, and addSlashes().
MyTextSanitizer::makeTboxData4Show | ( | $text, | |
$smiley = 0 |
|||
) |
MyTextSanitizer::makeTboxData4Show()
mixed | $text | |
mixed | $smiley |
Definition at line 790 of file module.textsanitizer.php.
References $GLOBALS, $text, and htmlSpecialChars().
MyTextSanitizer::mergeConfig | ( | $config_default, | |
$config_custom | |||
) |
Enter description here...
array | $config_default | |
array | $config_custom |
Definition at line 215 of file module.textsanitizer.php.
Referenced by loadConfig().
MyTextSanitizer::MyTextSanitizer | ( | ) |
Constructor of this class
Gets allowed html tags from admin config settings
should not be allowed since nl2br will be used when storing data.
private
Definition at line 184 of file module.textsanitizer.php.
References __construct().
Referenced by getInstance().
MyTextSanitizer::nl2Br | ( | $text | ) |
Convert linebreaks to
tags
string | $text |
Definition at line 440 of file module.textsanitizer.php.
References $text.
Referenced by displayTarea(), sanitizeForDisplay(), and sanitizeForPreview().
MyTextSanitizer::oopsAddSlashes | ( | $text | ) |
MyTextSanitizer::oopsAddSlashes()
mixed | $text |
Definition at line 952 of file module.textsanitizer.php.
References $GLOBALS, $text, and addSlashes().
MyTextSanitizer::oopsHtmlSpecialChars | ( | $text | ) |
MyTextSanitizer::oopsHtmlSpecialChars()
mixed | $text |
Definition at line 964 of file module.textsanitizer.php.
References $GLOBALS, $text, and htmlSpecialChars().
MyTextSanitizer::oopsNl2Br | ( | $text | ) |
MyTextSanitizer::oopsStripSlashesGPC | ( | $text | ) |
MyTextSanitizer::oopsStripSlashesGPC()
mixed | $text |
Definition at line 925 of file module.textsanitizer.php.
References $GLOBALS, $text, and stripSlashesGPC().
Referenced by sanitizeForPreview().
MyTextSanitizer::oopsStripSlashesRT | ( | $text | ) |
MyTextSanitizer::oopsStripSlashesRT()
mixed | $text |
Definition at line 937 of file module.textsanitizer.php.
& MyTextSanitizer::previewTarea | ( | $text, | |
$html = 0 , |
|||
$smiley = 1 , |
|||
$xcode = 1 , |
|||
$image = 1 , |
|||
$br = 1 |
|||
) |
Filters textarea form data submitted for preview
string | $text | |
bool | $html | allow html? |
bool | $smiley | allow smileys? |
bool | $xcode | allow xoopscode? |
bool | $image | allow inline images? |
bool | $br | convert linebreaks? |
Definition at line 559 of file module.textsanitizer.php.
References $html, $image, $text, displayTarea(), and stripSlashesGPC().
Referenced by makeTareaData4Preview().
MyTextSanitizer::quoteConv | ( | $text | ) |
Convert quote tags
string | $text |
Definition at line 398 of file module.textsanitizer.php.
References $text, and _QUOTEC.
Referenced by xoopsCodeDecode().
MyTextSanitizer::sanitizeForDisplay | ( | $text, | |
$allowhtml = 0 , |
|||
$smiley = 1 , |
|||
$bbcode = 1 |
|||
) |
MyTextSanitizer::sanitizeForDisplay()
mixed | $text | |
integer | $allowhtml | |
integer | $smiley | |
mixed | $bbcode |
Definition at line 718 of file module.textsanitizer.php.
References $GLOBALS, $text, htmlSpecialChars(), makeClickable(), nl2Br(), smiley(), and xoopsCodeDecode().
MyTextSanitizer::sanitizeForPreview | ( | $text, | |
$allowhtml = 0 , |
|||
$smiley = 1 , |
|||
$bbcode = 1 |
|||
) |
MyTextSanitizer::sanitizeForPreview()
mixed | $text | |
integer | $allowhtml | |
integer | $smiley | |
mixed | $bbcode |
Definition at line 748 of file module.textsanitizer.php.
References $GLOBALS, $text, htmlSpecialChars(), makeClickable(), nl2Br(), oopsStripSlashesGPC(), smiley(), and xoopsCodeDecode().
MyTextSanitizer::smiley | ( | $message | ) |
Replace emoticons in the message with smiley images
string | $message |
Definition at line 281 of file module.textsanitizer.php.
References $smileys, getSmileys(), and XOOPS_UPLOAD_URL.
Referenced by displayTarea(), sanitizeForDisplay(), and sanitizeForPreview().
MyTextSanitizer::stripSlashesGPC | ( | $text | ) |
if magic_quotes_gpc is on, stirip back slashes
string | $text |
Definition at line 465 of file module.textsanitizer.php.
References $text.
Referenced by makeTareaData4PreviewInForm(), makeTboxData4Preview(), makeTboxData4PreviewInForm(), oopsStripSlashesGPC(), and previewTarea().
MyTextSanitizer::textFilter | ( | $text, | |
$force = false |
|||
) |
Filter out possible malicious text kses project at SF could be a good solution to check
string | $text | text to filter |
bool | $force | force filtering |
Definition at line 679 of file module.textsanitizer.php.
References $ret, $text, and executeExtension().
MyTextSanitizer::truncate | ( | $text | ) |
mixed | $text |
Definition at line 325 of file module.textsanitizer.php.
References $ret, $text, and getInstance().
MyTextSanitizer::undoHtmlSpecialChars | ( | $text | ) |
Reverses htmlSpecialChars()
string | $text |
Definition at line 498 of file module.textsanitizer.php.
References $text.
& MyTextSanitizer::xoopsCodeDecode | ( | & | $text, |
$allowimage = 1 |
|||
) |
Replace XoopsCodes with their equivalent HTML formatting
string | $text | |
bool | $allowimage | Allow images in the text? On FALSE, uses links to images. |
Definition at line 344 of file module.textsanitizer.php.
References $patterns, $replacements, $text, executeExtensions(), and quoteConv().
Referenced by codeSanitizer(), displayTarea(), sanitizeForDisplay(), and sanitizeForPreview().
MyTextSanitizer::$censorConf |
Definition at line 152 of file module.textsanitizer.php.
MyTextSanitizer::$config |
Definition at line 165 of file module.textsanitizer.php.
MyTextSanitizer::$path_basic |
Definition at line 162 of file module.textsanitizer.php.
MyTextSanitizer::$path_plugin |
Definition at line 163 of file module.textsanitizer.php.
MyTextSanitizer::$patterns = array() |
Definition at line 159 of file module.textsanitizer.php.
Referenced by codeConv(), codePreConv(), filterXss(), makeClickable(), and xoopsCodeDecode().
MyTextSanitizer::$replacements = array() |
Definition at line 160 of file module.textsanitizer.php.
Referenced by codeConv(), codePreConv(), filterXss(), makeClickable(), and xoopsCodeDecode().
MyTextSanitizer::$smileys = array() |
Definition at line 148 of file module.textsanitizer.php.
Referenced by getSmileys(), and smiley().
MyTextSanitizer::$text = "" |
Definition at line 158 of file module.textsanitizer.php.
Referenced by addSlashes(), censorString(), codeConv(), codePreConv(), displayTarea(), filterXss(), htmlSpecialChars(), makeClickable(), makeTareaData4Edit(), makeTareaData4InsideQuotes(), makeTareaData4Preview(), makeTareaData4PreviewInForm(), makeTareaData4Save(), makeTareaData4Show(), makeTboxData4Edit(), makeTboxData4Preview(), makeTboxData4PreviewInForm(), makeTboxData4Save(), makeTboxData4Show(), nl2Br(), oopsAddSlashes(), oopsHtmlSpecialChars(), oopsNl2Br(), oopsStripSlashesGPC(), oopsStripSlashesRT(), previewTarea(), quoteConv(), sanitizeForDisplay(), sanitizeForPreview(), stripSlashesGPC(), textFilter(), truncate(), undoHtmlSpecialChars(), and xoopsCodeDecode().