Stud.IP  3.1 Revision 48552
 All Data Structures Namespaces Files Functions Variables Groups Pages
Markup Class Reference
Collaboration diagram for Markup:
Collaboration graph

Static Public Member Functions

static apply ($markup, $text, $trim)
static isHtml ($text)
static purify ($dirty_html)
static htmlReady ($text, $trim=true, $br=false, $double_encode=true)
static removeHTML ($html)

Member Function Documentation

static apply (   $markup,
  $text,
  $trim 
)
static

Apply markup rules and clean the text up.

Parameters
TextFormat$markupMarkup rules applied on marked-up text.
string$textMarked-up text on which rules are applied.
boolean$trimTrim text before applying markup rules, if TRUE.
Returns
string HTML code computed from marked-up text.
static htmlReady (   $text,
  $trim = true,
  $br = false,
  $double_encode = true 
)
static

Convert special characters to HTML entities, and clean up.

Parameters
string$textThis text's special chars will be converted.
boolean$trimTrim text before applying markup rules, if TRUE.
boolean$brReplace newlines by
, if TRUE.
boolean$double_encodeEncode existing HTML entities, if TRUE.
Returns
string The converted string.
static isHtml (   $text)
static

Return True for HTML code and False for plain text.

A fairly simple heuristic is used: Every text that begins with '<' and ends with '>' is considered to be HTML code. Leading and trailing whitespace characters are ignored.

Parameters
string$textHTML code or plain text.
Returns
boolean TRUE for HTML code, FALSE for plain text.
static purify (   $dirty_html)
static

Call HTMLPurifier to create safe HTML.

Parameters
string$dirty_htmlUnsafe or 'uncleaned' HTML code.
Returns
string Clean and safe HTML code.

Here is the call graph for this function:

static removeHTML (   $html)
static

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