XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
MyTextSanitizer Class Reference
Inheritance diagram for MyTextSanitizer:
Inheritance graph

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 = ""
 

Detailed Description

Definition at line 142 of file module.textsanitizer.php.

Constructor & Destructor Documentation

MyTextSanitizer::__construct ( )

Definition at line 167 of file module.textsanitizer.php.

References loadConfig().

Referenced by MyTextSanitizer().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Function Documentation

MyTextSanitizer::addSlashes (   $text)

Add slashes to the text if magic_quotes_gpc is turned off.

Parameters
string$text
Returns
string

Definition at line 451 of file module.textsanitizer.php.

References $text.

Referenced by makeTareaData4Save(), makeTboxData4Save(), and oopsAddSlashes().

Here is the caller graph for this function:

& MyTextSanitizer::censorString ( $text)

Replaces banned words in a string with their replacements

Parameters
string$text
Returns
string
Deprecated:

Definition at line 573 of file module.textsanitizer.php.

References $ret, $text, and executeExtension().

Here is the call graph for this function:

MyTextSanitizer::codeConv (   $text,
  $xcode = 1 
)

MyTextSanitizer::codeConv()

Parameters
mixed$text
mixed$xcode
Returns

Definition at line 606 of file module.textsanitizer.php.

References $patterns, $replacements, and $text.

Referenced by displayTarea().

Here is the caller graph for this function:

MyTextSanitizer::codePreConv (   $text,
  $xcode = 1 
)

MyTextSanitizer::codePreConv()

Parameters
mixed$text
mixed$xcode
Returns

Definition at line 589 of file module.textsanitizer.php.

References $patterns, $replacements, and $text.

Referenced by displayTarea().

Here is the caller graph for this function:

MyTextSanitizer::codeSanitizer (   $str,
  $image = 1 
)

*#@+

Deprecated:

MyTextSanitizer::codeSanitizer()

Parameters
mixed$str
mixed$image
Returns

Definition at line 701 of file module.textsanitizer.php.

References $GLOBALS, $image, htmlSpecialChars(), and xoopsCodeDecode().

Here is the call graph for this function:

& MyTextSanitizer::displayTarea (   $text,
  $html = 0,
  $smiley = 1,
  $xcode = 1,
  $image = 1,
  $br = 1 
)

Filters textarea form data in DB for display

Parameters
string$text
bool$htmlallow html?
bool$smileyallow smileys?
bool$xcodeallow xoopscode?
bool$imageallow inline images?
bool$brconvert linebreaks?
Returns
string

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().

Here is the call graph for this function:

Here is the caller graph for this function:

MyTextSanitizer::executeExtension (   $name)

MyTextSanitizer::executeExtension()

Parameters
mixed$name
Returns

Definition at line 664 of file module.textsanitizer.php.

References loadExtension().

Referenced by censorString(), executeExtensions(), and textFilter().

Here is the call graph for this function:

Here is the caller graph for this function:

MyTextSanitizer::executeExtensions ( )

MyTextSanitizer::executeExtensions()

Returns

Definition at line 622 of file module.textsanitizer.php.

References executeExtension().

Referenced by xoopsCodeDecode().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

MyTextSanitizer::getSmileys (   $isAll = true)

Get the smileys

Parameters
boole$isAllTRUE for all smileys, FALSE for smileys with display = 1
Returns
array

Definition at line 251 of file module.textsanitizer.php.

References $smileys, $xoopsDB, and XoopsDatabaseFactory\getDatabaseConnection().

Referenced by smiley().

Here is the call graph for this function:

Here is the caller graph for this function:

MyTextSanitizer::htmlSpecialChars (   $text,
  $quote_style = ENT_QUOTES,
  $charset = null,
  $double_encode = true 
)

Convert special characters to HTML entities

Parameters
string$textstring being converted
int$quote_style
string$charsetcharacter set used in conversion
bool$double_encode
Returns
string

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().

Here is the caller graph for this function:

MyTextSanitizer::loadConfig (   $name = null)

Enter description here...

Parameters
string$name
Returns
array

Definition at line 195 of file module.textsanitizer.php.

References $file, MyTextSanitizerExtension\loadConfig(), and mergeConfig().

Referenced by __construct().

Here is the call graph for this function:

Here is the caller graph for this function:

MyTextSanitizer::loadExtension (   $name)

MyTextSanitizer::loadExtension()

Parameters
mixed$name
Returns

Definition at line 639 of file module.textsanitizer.php.

References $file.

Referenced by executeExtension().

Here is the caller graph for this function:

MyTextSanitizer::makeClickable ( $text)

Make links in the text clickable

Parameters
string$text
Returns
string

Definition at line 296 of file module.textsanitizer.php.

References $patterns, $replacements, and $text.

Referenced by displayTarea(), sanitizeForDisplay(), and sanitizeForPreview().

Here is the caller graph for this function:

MyTextSanitizer::makeTareaData4Edit (   $text)

MyTextSanitizer::makeTareaData4Edit()

Parameters
mixed$text
Returns

Definition at line 871 of file module.textsanitizer.php.

References $GLOBALS, $text, and htmlSpecialChars().

Here is the call graph for this function:

MyTextSanitizer::makeTareaData4InsideQuotes (   $text)

MyTextSanitizer::makeTareaData4InsideQuotes()

Parameters
mixed$text
Returns

Definition at line 913 of file module.textsanitizer.php.

References $GLOBALS, $text, and htmlSpecialChars().

Here is the call graph for this function:

& MyTextSanitizer::makeTareaData4Preview ( $text,
  $html = 1,
  $smiley = 1,
  $xcode = 1 
)

MyTextSanitizer::makeTareaData4Preview()

Parameters
mixed$text
integer$html
integer$smiley
mixed$xcode
Returns

Definition at line 886 of file module.textsanitizer.php.

References $GLOBALS, $html, $text, and previewTarea().

Here is the call graph for this function:

MyTextSanitizer::makeTareaData4PreviewInForm (   $text)

MyTextSanitizer::makeTareaData4PreviewInForm()

Parameters
mixed$text
Returns

Definition at line 899 of file module.textsanitizer.php.

References $GLOBALS, $text, htmlSpecialChars(), and stripSlashesGPC().

Here is the call graph for this function:

MyTextSanitizer::makeTareaData4Save (   $text)

MyTextSanitizer::makeTareaData4Save()

Parameters
mixed$text
Returns

Definition at line 843 of file module.textsanitizer.php.

References $GLOBALS, $text, and addSlashes().

Here is the call graph for this function:

& MyTextSanitizer::makeTareaData4Show ( $text,
  $html = 1,
  $smiley = 1,
  $xcode = 1 
)

MyTextSanitizer::makeTareaData4Show()

Parameters
mixed$text
integer$html
integer$smiley
mixed$xcode
Returns

Definition at line 858 of file module.textsanitizer.php.

References $GLOBALS, $html, $text, and displayTarea().

Here is the call graph for this function:

MyTextSanitizer::makeTboxData4Edit (   $text)

MyTextSanitizer::makeTboxData4Edit()

Parameters
mixed$text
Returns

Definition at line 803 of file module.textsanitizer.php.

References $GLOBALS, $text, and htmlSpecialChars().

Here is the call graph for this function:

MyTextSanitizer::makeTboxData4Preview (   $text,
  $smiley = 0 
)

MyTextSanitizer::makeTboxData4Preview()

Parameters
mixed$text
mixed$smiley
Returns

Definition at line 816 of file module.textsanitizer.php.

References $GLOBALS, $text, htmlSpecialChars(), and stripSlashesGPC().

Here is the call graph for this function:

MyTextSanitizer::makeTboxData4PreviewInForm (   $text)

MyTextSanitizer::makeTboxData4PreviewInForm()

Parameters
mixed$text
Returns

Definition at line 830 of file module.textsanitizer.php.

References $GLOBALS, $text, htmlSpecialChars(), and stripSlashesGPC().

Here is the call graph for this function:

MyTextSanitizer::makeTboxData4Save (   $text)

MyTextSanitizer::makeTboxData4Save()

Parameters
mixed$text
Returns

Definition at line 776 of file module.textsanitizer.php.

References $GLOBALS, $text, and addSlashes().

Here is the call graph for this function:

MyTextSanitizer::makeTboxData4Show (   $text,
  $smiley = 0 
)

MyTextSanitizer::makeTboxData4Show()

Parameters
mixed$text
mixed$smiley
Returns

Definition at line 790 of file module.textsanitizer.php.

References $GLOBALS, $text, and htmlSpecialChars().

Here is the call graph for this function:

MyTextSanitizer::mergeConfig (   $config_default,
  $config_custom 
)

Enter description here...

Parameters
array$config_default
array$config_custom
Returns
unknown

Definition at line 215 of file module.textsanitizer.php.

Referenced by loadConfig().

Here is the caller graph for this function:

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

Todo:
Sofar, this does nuttin' ;-)

Definition at line 184 of file module.textsanitizer.php.

References __construct().

Referenced by getInstance().

Here is the call graph for this function:

Here is the caller graph for this function:

MyTextSanitizer::nl2Br (   $text)

Convert linebreaks to
tags

Parameters
string$text
Returns
string

Definition at line 440 of file module.textsanitizer.php.

References $text.

Referenced by displayTarea(), sanitizeForDisplay(), and sanitizeForPreview().

Here is the caller graph for this function:

MyTextSanitizer::oopsAddSlashes (   $text)

MyTextSanitizer::oopsAddSlashes()

Parameters
mixed$text
Returns

Definition at line 952 of file module.textsanitizer.php.

References $GLOBALS, $text, and addSlashes().

Here is the call graph for this function:

MyTextSanitizer::oopsHtmlSpecialChars (   $text)

MyTextSanitizer::oopsHtmlSpecialChars()

Parameters
mixed$text
Returns

Definition at line 964 of file module.textsanitizer.php.

References $GLOBALS, $text, and htmlSpecialChars().

Here is the call graph for this function:

MyTextSanitizer::oopsNl2Br (   $text)

MyTextSanitizer::oopsNl2Br()

Parameters
mixed$text
Returns

Definition at line 976 of file module.textsanitizer.php.

References $GLOBALS, and $text.

MyTextSanitizer::oopsStripSlashesGPC (   $text)

MyTextSanitizer::oopsStripSlashesGPC()

Parameters
mixed$text
Returns

Definition at line 925 of file module.textsanitizer.php.

References $GLOBALS, $text, and stripSlashesGPC().

Referenced by sanitizeForPreview().

Here is the call graph for this function:

Here is the caller graph for this function:

MyTextSanitizer::oopsStripSlashesRT (   $text)

MyTextSanitizer::oopsStripSlashesRT()

Parameters
mixed$text
Returns

Definition at line 937 of file module.textsanitizer.php.

References $GLOBALS, and $text.

& MyTextSanitizer::previewTarea (   $text,
  $html = 0,
  $smiley = 1,
  $xcode = 1,
  $image = 1,
  $br = 1 
)

Filters textarea form data submitted for preview

Parameters
string$text
bool$htmlallow html?
bool$smileyallow smileys?
bool$xcodeallow xoopscode?
bool$imageallow inline images?
bool$brconvert linebreaks?
Returns
string

Definition at line 559 of file module.textsanitizer.php.

References $html, $image, $text, displayTarea(), and stripSlashesGPC().

Referenced by makeTareaData4Preview().

Here is the call graph for this function:

Here is the caller graph for this function:

MyTextSanitizer::quoteConv (   $text)

Convert quote tags

Parameters
string$text
Returns
string

Definition at line 398 of file module.textsanitizer.php.

References $text, and _QUOTEC.

Referenced by xoopsCodeDecode().

Here is the caller graph for this function:

MyTextSanitizer::sanitizeForDisplay (   $text,
  $allowhtml = 0,
  $smiley = 1,
  $bbcode = 1 
)

MyTextSanitizer::sanitizeForDisplay()

Parameters
mixed$text
integer$allowhtml
integer$smiley
mixed$bbcode
Returns

Definition at line 718 of file module.textsanitizer.php.

References $GLOBALS, $text, htmlSpecialChars(), makeClickable(), nl2Br(), smiley(), and xoopsCodeDecode().

Here is the call graph for this function:

MyTextSanitizer::sanitizeForPreview (   $text,
  $allowhtml = 0,
  $smiley = 1,
  $bbcode = 1 
)

MyTextSanitizer::sanitizeForPreview()

Parameters
mixed$text
integer$allowhtml
integer$smiley
mixed$bbcode
Returns

Definition at line 748 of file module.textsanitizer.php.

References $GLOBALS, $text, htmlSpecialChars(), makeClickable(), nl2Br(), oopsStripSlashesGPC(), smiley(), and xoopsCodeDecode().

Here is the call graph for this function:

MyTextSanitizer::smiley (   $message)

Replace emoticons in the message with smiley images

Parameters
string$message
Returns
string

Definition at line 281 of file module.textsanitizer.php.

References $smileys, getSmileys(), and XOOPS_UPLOAD_URL.

Referenced by displayTarea(), sanitizeForDisplay(), and sanitizeForPreview().

Here is the call graph for this function:

Here is the caller graph for this function:

MyTextSanitizer::stripSlashesGPC (   $text)

if magic_quotes_gpc is on, stirip back slashes

Parameters
string$text
Returns
string

Definition at line 465 of file module.textsanitizer.php.

References $text.

Referenced by makeTareaData4PreviewInForm(), makeTboxData4Preview(), makeTboxData4PreviewInForm(), oopsStripSlashesGPC(), and previewTarea().

Here is the caller graph for this function:

MyTextSanitizer::textFilter (   $text,
  $force = false 
)

Filter out possible malicious text kses project at SF could be a good solution to check

Parameters
string$texttext to filter
bool$forceforce filtering
Returns
string filtered text

Definition at line 679 of file module.textsanitizer.php.

References $ret, $text, and executeExtension().

Here is the call graph for this function:

MyTextSanitizer::truncate (   $text)

MyTextSanitizer::truncate()

Parameters
mixed$text
Returns

Definition at line 325 of file module.textsanitizer.php.

References $ret, $text, and getInstance().

Here is the call graph for this function:

MyTextSanitizer::undoHtmlSpecialChars (   $text)

Reverses htmlSpecialChars()

Parameters
string$text
Returns
string

Definition at line 498 of file module.textsanitizer.php.

References $text.

& MyTextSanitizer::xoopsCodeDecode ( $text,
  $allowimage = 1 
)

Replace XoopsCodes with their equivalent HTML formatting

Parameters
string$text
bool$allowimageAllow images in the text? On FALSE, uses links to images.
Returns
string

Definition at line 344 of file module.textsanitizer.php.

References $patterns, $replacements, $text, executeExtensions(), and quoteConv().

Referenced by codeSanitizer(), displayTarea(), sanitizeForDisplay(), and sanitizeForPreview().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

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()
MyTextSanitizer::$replacements = array()
MyTextSanitizer::$smileys = array()

Definition at line 148 of file module.textsanitizer.php.

Referenced by getSmileys(), and smiley().


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