API - XOOPS 2.5.11 Beta 2
By monxoops.fr
MyTextSanitizer Class Reference
Inheritance diagram for MyTextSanitizer:

Public Member Functions

 __construct ()
 
 loadConfig ($name=null)
 
 mergeConfig ($config_default, $config_custom)
 
 getSmileys ($isAll=true)
 
 smiley ($message)
 
 makeClickable ($text)
 
 truncate ($text)
 
xoopsCodeDecode (&$text, $allowimage=1)
 
 quoteConv ($text)
 
 filterXss ($text)
 
 nl2Br ($text)
 
 addSlashes ($text)
 
 htmlSpecialChars ($text, $quote_style=NULL, $charset=null, $double_encode=true)
 
 undoHtmlSpecialChars ($text)
 
displayTarea ($text, $html=0, $smiley=1, $xcode=1, $image=1, $br=1)
 
previewTarea ($text, $html=0, $smiley=1, $xcode=1, $image=1, $br=1)
 
censorString (&$text)
 
 codePreConv ($text, $xcode=1)
 
 codeConvCallback ($match)
 
 codeConv ($text, $xcode=1)
 
 executeExtensions ()
 
 loadExtension ($name)
 
 executeExtension ($name)
 
 textFilter ($text, $force=false)
 
 stripSlashesGPC ($text)
 
 codeSanitizer ($str, $image=1)
 
 sanitizeForDisplay ($text, $allowhtml=0, $smiley=1, $bbcode=1)
 
 sanitizeForPreview ($text, $allowhtml=0, $smiley=1, $bbcode=1)
 
 makeTboxData4Save ($text)
 
 makeTboxData4Show ($text, $smiley=0)
 
 makeTboxData4Edit ($text)
 
 makeTboxData4Preview ($text, $smiley=0)
 
 makeTboxData4PreviewInForm ($text)
 
 makeTareaData4Save ($text)
 
makeTareaData4Show (&$text, $html=1, $smiley=1, $xcode=1)
 
 makeTareaData4Edit ($text)
 
makeTareaData4Preview (&$text, $html=1, $smiley=1, $xcode=1)
 
 makeTareaData4PreviewInForm ($text)
 
 makeTareaData4InsideQuotes ($text)
 
 oopsStripSlashesGPC ($text)
 
 oopsStripSlashesRT ($text)
 
 oopsAddSlashes ($text)
 
 oopsHtmlSpecialChars ($text)
 
 oopsNl2Br ($text)
 

Static Public Member Functions

static getInstance ()
 

Data Fields

 $smileys = array()
 
 $censorConf
 
 $text = ''
 
 $patterns = array()
 
 $replacements = array()
 
 $callbackPatterns = array()
 
 $callbacks = array()
 
 $path_basic
 
 $path_config
 
 $path_plugin
 
 $config
 

Protected Member Functions

 makeClickableCallbackEmailAddress ($match)
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Constructor of this class

Gets allowed html tags from admin config settings
should not be allowed since nl2br will be used when storing data.

@access private

Here is the call graph for this function:

Member Function Documentation

◆ addSlashes()

addSlashes (   $text)

Add slashes to the text if magic_quotes_gpc is turned off.

Parameters
string$text
Returns
string
Here is the caller graph for this function:

◆ censorString()

& censorString ( $text)

Replaces banned words in a string with their replacements

Parameters
string$text
Returns
string
Deprecated:
Here is the call graph for this function:

◆ codeConv()

codeConv (   $text,
  $xcode = 1 
)

MyTextSanitizer::codeConv()

Parameters
mixed$text
mixed$xcode
Returns
mixed
Here is the caller graph for this function:

◆ codeConvCallback()

codeConvCallback (   $match)
Parameters
$match
Returns
string
Here is the call graph for this function:

◆ codePreConv()

codePreConv (   $text,
  $xcode = 1 
)

MyTextSanitizer::codePreConv()

Parameters
mixed$text
mixed$xcode
Returns
mixed
Here is the caller graph for this function:

◆ codeSanitizer()

codeSanitizer (   $str,
  $image = 1 
)

MyTextSanitizer::codeSanitizer()

Parameters
mixed$str
mixed$image
Returns
mixed|string
Deprecated:
will be removed in next XOOPS version
Here is the call graph for this function:

◆ displayTarea()

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

Filters textarea form data in DB for display

Parameters
string$text
bool | int$htmlallow html?
bool | int$smileyallow smileys?
bool | int$xcodeallow xoopscode?
bool | int$imageallow inline images?
bool | int$brconvert linebreaks?
Returns
string
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeExtension()

executeExtension (   $name)

MyTextSanitizer::executeExtension()

Parameters
mixed$name
Returns
mixed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeExtensions()

executeExtensions ( )

MyTextSanitizer::executeExtensions()

Returns
bool
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filterXss()

filterXss (   $text)

A quick solution for filtering XSS scripts

@TODO : To be improved

Parameters
$text
Returns
mixed
Here is the caller graph for this function:

◆ getInstance()

static getInstance ( )
static

Access the only instance of this class

Returns
MyTextSanitizer
Here is the caller graph for this function:

◆ getSmileys()

getSmileys (   $isAll = true)

Get the smileys

Parameters
bool$isAllTRUE for all smileys, FALSE for smileys with display = 1
Returns
array
Here is the call graph for this function:
Here is the caller graph for this function:

◆ htmlSpecialChars()

htmlSpecialChars (   $text,
  $quote_style = NULL,
  $charset = null,
  $double_encode = true 
)

Convert special characters to HTML entities

Parameters
string$textstring being converted
int | null$quote_style
string$charsetcharacter set used in conversion
bool$double_encode
Returns
string
Here is the caller graph for this function:

◆ loadConfig()

loadConfig (   $name = null)

Enter description here...

Parameters
string$name
Returns
array|string
Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadExtension()

loadExtension (   $name)

MyTextSanitizer::loadExtension()

Parameters
mixed$name
Returns
MyTextSanitizerExtension|false
Here is the caller graph for this function:

◆ makeClickable()

makeClickable (   $text)

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

Parameters
string$text
Returns
string
Here is the caller graph for this function:

◆ makeClickableCallbackEmailAddress()

makeClickableCallbackEmailAddress (   $match)
protected

Callback to process email address match

Parameters
array$matcharray of matched elements
Returns
string

◆ makeTareaData4Edit()

makeTareaData4Edit (   $text)

MyTextSanitizer::makeTareaData4Edit()

Parameters
mixed$text
Returns
string
Deprecated:
will be removed in next XOOPS version
Here is the call graph for this function:

◆ makeTareaData4InsideQuotes()

makeTareaData4InsideQuotes (   $text)

MyTextSanitizer::makeTareaData4InsideQuotes()

Parameters
mixed$text
Returns
string
Deprecated:
will be removed in next XOOPS version
Here is the call graph for this function:

◆ makeTareaData4Preview()

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

MyTextSanitizer::makeTareaData4Preview()

Parameters
mixed$text
integer$html
integer$smiley
mixed$xcode
Returns
mixed|string
Deprecated:
will be removed in next XOOPS version
Here is the call graph for this function:

◆ makeTareaData4PreviewInForm()

makeTareaData4PreviewInForm (   $text)

MyTextSanitizer::makeTareaData4PreviewInForm()

Parameters
mixed$text
Returns
string
Deprecated:
will be removed in next XOOPS version
Here is the call graph for this function:

◆ makeTareaData4Save()

makeTareaData4Save (   $text)

MyTextSanitizer::makeTareaData4Save()

Parameters
mixed$text
Returns
string
Deprecated:
will be removed in next XOOPS version
Here is the call graph for this function:

◆ makeTareaData4Show()

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

MyTextSanitizer::makeTareaData4Show()

Parameters
mixed$text
integer$html
integer$smiley
mixed$xcode
Returns
mixed|string
Deprecated:
will be removed in next XOOPS version
Here is the call graph for this function:

◆ makeTboxData4Edit()

makeTboxData4Edit (   $text)

MyTextSanitizer::makeTboxData4Edit()

Parameters
mixed$text
Returns
string
Deprecated:
will be removed in next XOOPS version
Here is the call graph for this function:

◆ makeTboxData4Preview()

makeTboxData4Preview (   $text,
  $smiley = 0 
)

MyTextSanitizer::makeTboxData4Preview()

Parameters
mixed$text
mixed$smiley
Returns
mixed|string
Deprecated:
will be removed in next XOOPS version
Here is the call graph for this function:

◆ makeTboxData4PreviewInForm()

makeTboxData4PreviewInForm (   $text)

MyTextSanitizer::makeTboxData4PreviewInForm()

Parameters
mixed$text
Returns
string
Deprecated:
will be removed in next XOOPS version
Here is the call graph for this function:

◆ makeTboxData4Save()

makeTboxData4Save (   $text)

MyTextSanitizer::makeTboxData4Save()

Parameters
mixed$text
Returns
string
Deprecated:
will be removed in next XOOPS version
Here is the call graph for this function:

◆ makeTboxData4Show()

makeTboxData4Show (   $text,
  $smiley = 0 
)

MyTextSanitizer::makeTboxData4Show()

Parameters
mixed$text
mixed$smiley
Returns
mixed|string
Deprecated:
will be removed in next XOOPS version
Here is the call graph for this function:

◆ mergeConfig()

mergeConfig (   $config_default,
  $config_custom 
)

Enter description here...

Parameters
array$config_default
array$config_custom
Returns
mixed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ nl2Br()

nl2Br (   $text)

Convert linebreaks to
tags

Parameters
string$text
Returns
string
Here is the caller graph for this function:

◆ oopsAddSlashes()

oopsAddSlashes (   $text)

MyTextSanitizer::oopsAddSlashes()

Parameters
mixed$text
Returns
string
Deprecated:
will be removed in next XOOPS version
Here is the call graph for this function:

◆ oopsHtmlSpecialChars()

oopsHtmlSpecialChars (   $text)

MyTextSanitizer::oopsHtmlSpecialChars()

Parameters
mixed$text
Returns
string
Deprecated:
will be removed in next XOOPS version
Here is the call graph for this function:

◆ oopsNl2Br()

oopsNl2Br (   $text)

MyTextSanitizer::oopsNl2Br()

Parameters
mixed$text
Returns
string
Deprecated:
will be removed in next XOOPS version
Here is the call graph for this function:

◆ oopsStripSlashesGPC()

oopsStripSlashesGPC (   $text)

MyTextSanitizer::oopsStripSlashesGPC()

Parameters
mixed$text
Returns
string
Deprecated:
will be removed in next XOOPS version
Here is the call graph for this function:
Here is the caller graph for this function:

◆ oopsStripSlashesRT()

oopsStripSlashesRT (   $text)

MyTextSanitizer::oopsStripSlashesRT()

Parameters
mixed$text
Returns
mixed|string
Deprecated:
will be removed in next XOOPS version

◆ previewTarea()

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

Filters textarea form data submitted for preview

Parameters
string$text
bool | int$htmlallow html?
bool | int$smileyallow smileys?
bool | int$xcodeallow xoopscode?
bool | int$imageallow inline images?
bool | int$brconvert linebreaks?
Returns
string
Here is the call graph for this function:
Here is the caller graph for this function:

◆ quoteConv()

quoteConv (   $text)

Convert quote tags

Parameters
string$text
Returns
string
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sanitizeForDisplay()

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

MyTextSanitizer::sanitizeForDisplay()

Parameters
mixed$text
integer$allowhtml
integer$smiley
mixed$bbcode
Returns
mixed|string
Deprecated:
will be removed in next XOOPS version
Here is the call graph for this function:

◆ sanitizeForPreview()

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

MyTextSanitizer::sanitizeForPreview()

Parameters
mixed$text
integer$allowhtml
integer$smiley
mixed$bbcode
Returns
mixed|string
Deprecated:
will be removed in next XOOPS version
Here is the call graph for this function:

◆ smiley()

smiley (   $message)

Replace emoticons in the message with smiley images

Parameters
string$message
Returns
string
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stripSlashesGPC()

stripSlashesGPC (   $text)

if magic_quotes_gpc is on, strip back slashes

Parameters
string$text
Returns
string
Deprecated:
as of XOOPS 2.5.11 and will be removed in next XOOPS version

This remains here until we officially drop support for PHP 5.3 in next release

Here is the caller graph for this function:

◆ textFilter()

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
Here is the call graph for this function:

◆ truncate()

truncate (   $text)

MyTextSanitizer::truncate()

Parameters
mixed$text
Returns
mixed|string
Here is the call graph for this function:

◆ undoHtmlSpecialChars()

undoHtmlSpecialChars (   $text)

Reverses htmlSpecialChars()

Parameters
string$text
Returns
string

◆ xoopsCodeDecode()

& xoopsCodeDecode ( $text,
  $allowimage = 1 
)

Replace XoopsCodes with their equivalent HTML formatting

Parameters
string$text
bool | int$allowimageAllow images in the text? On FALSE, uses links to images.
Returns
string
Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ $callbackPatterns

$callbackPatterns = array()

◆ $callbacks

$callbacks = array()

◆ $censorConf

$censorConf

◆ $config

$config

◆ $path_basic

$path_basic

◆ $path_config

$path_config

◆ $path_plugin

$path_plugin

◆ $patterns

$patterns = array()

◆ $replacements

$replacements = array()

◆ $smileys

$smileys = array()

◆ $text

$text = ''

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