Helper
class Helper
Properties
string | $allowed | ||
string | $attrName | ||
string | $defaultReplacement | ||
string | $regexp | ||
string | $regexpHtml | ||
array | $replacements | ||
string | $tagName |
Methods
__construct(array $config)
Constructor
string
censorHtml(string $html, bool $censorAttributes = false)
Censor text nodes inside of HTML code
string
censorText(string $text)
Censor given plain text
bool
isCensored(string $word)
Test whether given word is censored
string
getReplacement(string $word)
Get the replacement for given word
bool
isAllowed(string $word)
Test whether given word is allowed (whitelisted)
Details
at line 52
__construct(array $config)
Constructor
at line 69
string
censorHtml(string $html, bool $censorAttributes = false)
Censor text nodes inside of HTML code
NOTE: will only recognize attributes that are enclosed in double quotes
at line 103
string
censorText(string $text)
Censor given plain text
at line 121
bool
isCensored(string $word)
Test whether given word is censored
at line 132
protected string
getReplacement(string $word)
Get the replacement for given word
at line 156
protected bool
isAllowed(string $word)
Test whether given word is allowed (whitelisted)