XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
MyTextSanitizer Class Reference

Public Member Functions

 __construct ()
 
 getSmileys ()
 
smiley ($text)
 
makeClickable ($text)
 
xoopsCodeDecode ($text, $allowimage=1)
 
 _filterImgUrl ($matches)
 
 checkUrlString ($text)
 
nl2Br ($text)
 
 addSlashes ($text)
 
stripSlashesGPC ($text)
 
htmlSpecialChars ($text, $forEdit=false)
 
undoHtmlSpecialChars ($text)
 
 _ToShowTarea ($text, $html=0, $smiley=1, $xcode=1, $image=1, $br=1)
 
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)
 
 codeConv ($text, $xcode=1, $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 & sGetInstance ()
 
static & getInstance ()
 

Data Fields

 $censorConf
 
 $mTextFilter = null
 
 $mMakeClickablePostFilter = null
 
 $mXoopsCodePostFilter = null
 

Detailed Description

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

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

Todo
So far, this does nuttin' ;-)

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

Member Function Documentation

◆ _filterImgUrl()

_filterImgUrl ( $matches)

Filters out invalid strings included in URL, if any

Parameters
array$matches
Returns
string

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

◆ _ToShowTarea()

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

Filters textarea data for display (This method makes overhead but needed for compatibility)

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

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

◆ addSlashes()

addSlashes ( $text)

Add slashes to the text.

Parameters
string$text
Returns
string

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

◆ censorString()

& censorString ( $text)

Replaces banned words in a string with their replacements

Parameters
string$text
Returns
string
Deprecated

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

◆ checkUrlString()

checkUrlString ( $text)

Checks if invalid strings are included in URL

Parameters
string$text
Returns
bool

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

◆ codeConv()

codeConv ( $text,
$xcode = 1,
$image = 1 )

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

◆ codePreConv()

codePreConv ( $text,
$xcode = 1 )

#+ Sanitizing of [code] tag

Parameters
$text
int$xcode
Returns

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

◆ displayTarea()

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

Filters textarea form data in DB for display

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

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

◆ getInstance()

static & getInstance ( )
static

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

◆ getSmileys()

getSmileys ( )

Get the smileys

Returns
array

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

◆ htmlSpecialChars()

& htmlSpecialChars ( $text,
$forEdit = false )

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

◆ makeClickable()

& makeClickable ( $text)

Make links in the text clickable

Parameters
string$text
Returns
string

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

◆ makeTareaData4Edit()

makeTareaData4Edit ( $text)

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

◆ makeTareaData4InsideQuotes()

makeTareaData4InsideQuotes ( $text)

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

◆ makeTareaData4Preview()

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

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

◆ makeTareaData4PreviewInForm()

makeTareaData4PreviewInForm ( $text)

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

◆ makeTareaData4Save()

makeTareaData4Save ( $text)

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

◆ makeTareaData4Show()

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

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

◆ makeTboxData4Edit()

makeTboxData4Edit ( $text)

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

◆ makeTboxData4Preview()

makeTboxData4Preview ( $text,
$smiley = 0 )

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

◆ makeTboxData4PreviewInForm()

makeTboxData4PreviewInForm ( $text)

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

◆ makeTboxData4Save()

makeTboxData4Save ( $text)

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

◆ makeTboxData4Show()

makeTboxData4Show ( $text,
$smiley = 0 )

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

◆ nl2Br()

& nl2Br ( $text)

Convert linebreaks to
tags

Parameters
string$text
Returns
string

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

◆ oopsAddSlashes()

& oopsAddSlashes ( $text)

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

◆ oopsHtmlSpecialChars()

& oopsHtmlSpecialChars ( $text)

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

◆ oopsNl2Br()

& oopsNl2Br ( $text)

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

◆ oopsStripSlashesGPC()

& oopsStripSlashesGPC ( $text)

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

◆ oopsStripSlashesRT()

& oopsStripSlashesRT ( $text)

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

◆ previewTarea()

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

Filters textarea form data submitted for preview

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

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

◆ sanitizeForDisplay()

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

#+

Parameters
$text
int$allowhtml
int$smiley
int$bbcode
Returns
string
Deprecated

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

◆ sanitizeForPreview()

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

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

◆ sGetInstance()

static & sGetInstance ( )
static

Access the only instance of this class

Returns
object

@staticvar object

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

◆ smiley()

& smiley ( $text)

Replace emoticons in the message with smiley images

Parameters
$text
Returns
string

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

◆ stripSlashesGPC()

& stripSlashesGPC ( $text)

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

◆ undoHtmlSpecialChars()

& undoHtmlSpecialChars ( $text)

Reverses htmlSpecialChars()

Parameters
string$text
Returns
string
Deprecated

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

◆ xoopsCodeDecode()

& xoopsCodeDecode ( $text,
$allowimage = 1 )

Replace XoopsCodes with their equivalent HTML formatting

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

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

Field Documentation

◆ $censorConf

$censorConf

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

◆ $mMakeClickablePostFilter

$mMakeClickablePostFilter = null

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

◆ $mTextFilter

$mTextFilter = null

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

◆ $mXoopsCodePostFilter

$mXoopsCodePostFilter = null

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


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