mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[ticket/10240] Added censor_text tests.
PHPBB-10240
This commit is contained in:
@@ -41,6 +41,28 @@ class phpbb_mock_cache
|
||||
{
|
||||
return $this->data['_bots'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain list of word censors. We don't need to parse them here,
|
||||
* that is tested elsewhere.
|
||||
*/
|
||||
public function obtain_word_list()
|
||||
{
|
||||
return array(
|
||||
'match' => array(
|
||||
'#(?<![\\p{Nd}\\p{L}_-])([\\p{Nd}\\p{L}_-]*?badword1[\\p{Nd}\\p{L}_-]*?)(?![\\p{Nd}\\p{L}_-])#iu',
|
||||
'#(?<![\\p{Nd}\\p{L}_-])([\\p{Nd}\\p{L}_-]*?badword2)(?![\\p{Nd}\\p{L}_-])#iu',
|
||||
'#(?<![\\p{Nd}\\p{L}_-])(badword3[\\p{Nd}\\p{L}_-]*?)(?![\\p{Nd}\\p{L}_-])#iu',
|
||||
'#(?<![\\p{Nd}\\p{L}_-])(badword4)(?![\\p{Nd}\\p{L}_-])#iu',
|
||||
),
|
||||
'replace' => array(
|
||||
'replacement1',
|
||||
'replacement2',
|
||||
'replacement3',
|
||||
'replacement4',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
public function set_bots($bots)
|
||||
{
|
||||
|
Reference in New Issue
Block a user