Overview

Packages

  • Auth
    • Ads
    • Ldap
    • Xoops
  • Autotasks
  • Config
    • Category
    • Item
    • Option
  • Core
    • Filesystem
    • Filters
    • Logger
    • Mail
    • Message
    • Password
    • Security
    • StopSpammer
    • Template
    • Textsanitizer
    • VersionChecker
  • Data
    • Avatar
    • Comment
  • Database
    • Connection
    • Criteria
    • Legacy
    • MySQL
    • PDO
    • Updater
  • Feeds
    • RSS
  • File
  • Form
    • Base
    • Elements
  • ICMS
    • IPF
      • View
  • Image
    • Category
  • Ipf
    • Category
    • Controller
    • Export
    • form
    • Keyhighlighter
    • Member
    • Object
    • Permission
    • richfile
    • Tree
    • urllink
    • View
  • kernel
    • Set
  • Member
    • Group
    • GroupMembership
    • GroupPermission
    • User
  • Messaging
  • Module
  • None
  • Notification
  • Page
  • Plugins
    • Editor
  • Preload
    • Libraries
  • Privmessage
  • Session
  • SmartObject
  • View
    • Block
    • Breadcrumb
    • PageNav
    • PrinterFriendly
    • Template
    • Templates
    • Theme
    • Tree

Classes

  • icms_core_Textsanitizer
  • Overview
  • Package
  • Class

Class icms_core_Textsanitizer

Class to "clean up" text for various uses

Singleton

Package: Core\Textsanitizer
Category: ICMS
Copyright: (c) 2000-2003 The Xoops Project - www.xoops.org
License: GNU General Public License (GPL)
Author: Kazumi Ono onokazu@xoops.org
Author: Goghs Cheng
Located at core/Textsanitizer.php
Methods summary
public
# __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.

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

public static object
# getInstance( )

Access the only instance of this class

Access the only instance of this class

Returns

object
public array
# getSmileys( boolean $all = false )

Get the smileys

Get the smileys

Parameters

$all

Returns

array
public string
# smiley( string $message )

Replace emoticons in the message with smiley images

Replace emoticons in the message with smiley images

Parameters

$message

Returns

string
public string
# makeClickable( string & $text )

Make links in the text clickable

Make links in the text clickable

Parameters

$text

Returns

string
public string
# xoopsCodeDecode( string & $text, boolean $allowimage = 1 )

Replace XoopsCodes with their equivalent HTML formatting

Replace XoopsCodes with their equivalent HTML formatting

Parameters

$text
$allowimage

Allow images in the text? On FALSE, uses links to images.

Returns

string
public string
# _filterImgUrl( array $matches )

Filters out invalid strings included in URL, if any

Filters out invalid strings included in URL, if any

Parameters

$matches

Returns

string
public boolean
# checkUrlString( string $text )

Checks if invalid strings are included in URL

Checks if invalid strings are included in URL

Parameters

$text

Returns

boolean
public string
# nl2Br( string $text )

Convert linebreaks to
tags

Convert linebreaks to
tags

Parameters

$text

Returns

string
public string
# addSlashes( string $text )

Note: magic_quotes_gpc and magic_quotes_runtime are deprecated as of PHP5.3.0

Note: magic_quotes_gpc and magic_quotes_runtime are deprecated as of PHP5.3.0

Add slashes to the text if magic_quotes_gpc is turned off.

Parameters

$text

Returns

string
public string
# stripSlashesGPC( string $text )

Note: magic_quotes_gpc and magic_quotes_runtime are deprecated as of PHP5.3.0

Note: magic_quotes_gpc and magic_quotes_runtime are deprecated as of PHP5.3.0

if magic_quotes_gpc is on, strip back slashes

Parameters

$text

Returns

string
public string
# htmlSpecialChars( string $text )

for displaying data in html textbox forms

for displaying data in html textbox forms

Parameters

$text

Returns

string
public static string
# undoHtmlSpecialChars( string $text )

Reverses icms_core_Textsanitizer::htmlSpecialChars()

Reverses icms_core_Textsanitizer::htmlSpecialChars()

Parameters

$text

Returns

string
public
# icms_htmlEntities( $text )
public string
# displayTarea( string $text, boolean $html = 0, boolean $smiley = 1, boolean $xcode = 1, boolean $image = 1, boolean $br = 1 )

Filters textarea form data in DB for display

Filters textarea form data in DB for display

Parameters

$text
$html
allow html?
$smiley
allow smileys?
$xcode
allow xoopscode?
$image
allow inline images?
$br
convert linebreaks?

Returns

string
public string
# previewTarea( string $text, boolean $html = 0, boolean $smiley = 1, boolean $xcode = 1, boolean $image = 1, boolean $br = 1 )

Filters textarea form data submitted for preview

Filters textarea form data submitted for preview

The only difference between this and displayTarea is the need to deal with $_POST input instead of database output

Parameters

$text
$html
allow html?
$smiley
allow smileys?
$xcode
allow xoopscode?
$image
allow inline images?
$br
convert linebreaks?

Returns

string
public string
# censorString( string & $text )

Replaces banned words in a string with their replacements

Replaces banned words in a string with their replacements

Parameters

$text

Returns

string
public
# codePreConv( $text, $xcode = 1 )

Sanitizing of [code] tag

Sanitizing of [code] tag

public string
# codeConv( string $text, integer $xcode = 1, integer $image = 1 )

Converts text to xcode

Converts text to xcode

Parameters

$text
Text to convert
$xcode
Is the code Xcode?
$image
configuration for the purifier

Returns

string
$text the converted text
public string
# codeSanitizer( string $str, string $image = 1 )

Sanitizes decoded string

Sanitizes decoded string

Parameters

$str
String to sanitize
$image
Is the string an image

Returns

string
$str The sanitized decoded string
public
# sanitizeForDisplay( unknown_type $text, unknown_type $allowhtml = 0, unknown_type $smiley = 1, unknown_type $bbcode = 1 )

Deprecated

Use displayTarea, instead

Parameters

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

Deprecated

Use displayTarea, instead

Parameters

$text
$allowhtml
$smiley
$bbcode
public
# makeTboxData4Save( unknown_type $text )

Deprecated

Use addSlashes, instead

Parameters

$text
public
# makeTboxData4Show( $text, $smiley = 0 )

Deprecated

Use htmlSpecialChars, instead

Parameters

$text
$smiley
public
# makeTboxData4Edit( $text )

Deprecated

Use htmlSpecialChars, instead

Parameters

$text
public
# makeTboxData4Preview( $text, $smiley = 0 )

Deprecated

Use stripSlashesGPC, htmlSpecialChars

Parameters

$text
$smiley
public
# makeTboxData4PreviewInForm( unknown_type $text )

Deprecated

Use stripSlashesGPC, htmlSpecialChars

Parameters

$text
public
# makeTareaData4Save( $text )

Deprecated

Use addSlashes, instead

Parameters

$text
public
# makeTareaData4Show( unknown_type & $text, unknown_type $html = 0, unknown_type $smiley = 1, unknown_type $xcode = 1 )

Deprecated

Use displayTarea, instead

Parameters

$text
$html
$smiley
$xcode
public
# makeTareaData4Edit( $text )

Deprecated

Use htmlSpecialChars, instead

Parameters

$text
public
# makeTareaData4Preview( unknown_type & $text, unknown_type $html = 0, unknown_type $smiley = 1, unknown_type $xcode = 1 )

Deprecated

Use previewTarea, instead

Parameters

$text
$html
$smiley
$xcode
public
# makeTareaData4PreviewInForm( str $text )

Deprecated

icms_core_DataFilter::checkVar - type = text

Parameters

$text
public
# makeTareaData4InsideQuotes( $text )

Deprecated

Use htmlSpecialChars, instead

Parameters

$text
public
# oopsStripSlashesGPC( $text )

Note: magic_quotes_gpc and magic_quotes_runtime are deprecated as of PHP 5.3.0

Note: magic_quotes_gpc and magic_quotes_runtime are deprecated as of PHP 5.3.0

Deprecated

Use stripSlashesGPC, instead

Parameters

$text
public
# oopsStripSlashesRT( unknown_type $text )

Note: magic_quotes_gpc and magic_quotes_runtime are deprecated as of PHP 5.3.0

Note: magic_quotes_gpc and magic_quotes_runtime are deprecated as of PHP 5.3.0

Deprecated

Use stripSlashesGPC, instead.

Parameters

$text
public
# oopsAddSlashes( $text )

Deprecated

Use addSlashes, instead

Parameters

$text
public
# oopsHtmlSpecialChars( $text )

Deprecated

Use htmlSpecialChars, instead

Parameters

$text
public
# oopsNl2Br( $text )

Deprecated

use nl2br, instead

Parameters

$text
public object
# icmsCodeDecode_extended( integer $text, boolean $allowimage = 1 )

This function gets allowed plugins from DB and loads them in the sanitizer

This function gets allowed plugins from DB and loads them in the sanitizer

Parameters

$text
$id ID of the config
$allowimage
$withoptions load the config's options now?

Returns

object
reference to the icms_config_Item_Object
public boolean
# icmsloadExtension( string $name )

Starts HTML Purifier (from icms.htmlpurifier class)

Starts HTML Purifier (from icms.htmlpurifier class)

Parameters

$name
Name of the extension to load

Returns

boolean
public array
# icmsExecuteExtension( string $name, string $text )

Executes file with a certain extension using call_user_func_array

Executes file with a certain extension using call_user_func_array

Parameters

$name
Name of the file to load
$text
Text to show if the function doesn't exist

Returns

array
the return of the called function
public string
# textsanitizer_syntaxhighlight( string & $text )

Syntaxhighlight the code

Syntaxhighlight the code

Parameters

$text
purifies (lightly) and then syntax highlights the text

Returns

string
$text the syntax highlighted text
public string
# textsanitizer_php_highlight( string $text )

Syntaxhighlight the code using PHP highlight

Syntaxhighlight the code using PHP highlight

Parameters

$text
Text to highlight

Returns

string
$buffer the highlighted text
public string
# textsanitizer_geshi_highlight( string $text )

Syntaxhighlight the code using Geshi highlight

Syntaxhighlight the code using Geshi highlight

Parameters

$text
The text to highlight

Returns

string
$code the highlighted text
Properties summary
public array $displaySmileys

Public

array
# array()
public array $allSmileys

Public

array
# array()
public $censorConf
#
API documentation generated by ApiGen