vB_Utility_Censor
in package
Uses
vB_Utility_Trait_NoSerialize
Table of Contents
- $nonwordChar : mixed
- $reList : mixed
- $stringUtil : mixed
- __construct() : mixed
- Constructor
- __serialize() : mixed
- __sleep() : mixed
- __unserialize() : mixed
- __wakeup() : mixed
- match() : mixed
- replace() : string
- Replaces any instances of words censored in the censor text with replacechar
- getCensorReList() : mixed
- getCensorTermList() : mixed
Properties
$nonwordChar
private
mixed
$nonwordChar
= '\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f'
$reList
private
mixed
$reList
$stringUtil
private
mixed
$stringUtil
Methods
__construct()
Constructor
public
__construct(mixed $stringUtil, mixed $censortext) : mixed
Parameters
- $stringUtil : mixed
- $censortext : mixed
Return values
mixed —__serialize()
public
__serialize() : mixed
Return values
mixed —__sleep()
public
__sleep() : mixed
Return values
mixed —__unserialize()
public
__unserialize(mixed $serialized) : mixed
Parameters
- $serialized : mixed
Return values
mixed —__wakeup()
public
__wakeup() : mixed
Return values
mixed —match()
public
match(mixed $text) : mixed
Parameters
- $text : mixed
Return values
mixed —replace()
Replaces any instances of words censored in the censor text with replacechar
public
replace(string $text, string $replacechar) : string
Parameters
- $text : string
- $replacechar : string
-
-- the string to replace each character of a censored word with generally assumed to be a single character but there isn't any dependency on that (and I don't think the option that we generally use explicitly requires a single character). You can pass an empty string to strip the censored word instead of replacing it.
Return values
string —getCensorReList()
private
getCensorReList(mixed $terms) : mixed
Parameters
- $terms : mixed
Return values
mixed —getCensorTermList()
private
getCensorTermList(mixed $censortext) : mixed
Parameters
- $censortext : mixed