Skip to content

icms_core_Textsanitizer

Raimondas Rimkevičius edited this page Mar 9, 2020 · 1 revision
Notice: Wiki was automatic generated from project sources as project API documentation. Do not edit manually!

icms_core_Textsanitizer

Class to "clean up" text for various uses

Singleton

  • Class name: icms_core_Textsanitizer
  • Namespace:

Properties

$displaySmileys

public mixed $displaySmileys = array()
  • Visibility: public

$allSmileys

public mixed $allSmileys = array()
  • Visibility: public

$censorConf

public mixed $censorConf
  • Visibility: public

Methods

__construct

mixed icms_core_Textsanitizer::__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.

  • Visibility: public

getInstance

object icms_core_Textsanitizer::getInstance()

Access the only instance of this class

  • Visibility: public
  • This method is static.

_filterImgUrl

string icms_core_Textsanitizer::_filterImgUrl(array matches)

Filters out invalid strings included in URL, if any

  • Visibility: public

Arguments

  • matches array

checkUrlString

bool icms_core_Textsanitizer::checkUrlString(string text)

Checks if invalid strings are included in URL

  • Visibility: public

Arguments

  • text string

displayTarea

string icms_core_Textsanitizer::displayTarea(string text, bool html, bool smiley, bool xcode, bool image, bool br)

Filters textarea form data in DB for display

  • Visibility: public

Arguments

  • text string
  • html bool - <p>allow html?</p>
  • smiley bool - <p>allow smileys?</p>
  • xcode bool - <p>allow xoopscode?</p>
  • image bool - <p>allow inline images?</p>
  • br bool - <p>convert linebreaks?</p>

previewTarea

string icms_core_Textsanitizer::previewTarea(string text, bool html, bool smiley, bool xcode, bool image, bool br)

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

  • Visibility: public

Arguments

  • text string
  • html bool - <p>allow html?</p>
  • smiley bool - <p>allow smileys?</p>
  • xcode bool - <p>allow xoopscode?</p>
  • image bool - <p>allow inline images?</p>
  • br bool - <p>convert linebreaks?</p>
Clone this wiki locally