コード例 #1
0
ファイル: BadwordsTest.php プロジェクト: NicolasSchmutz/cm
 public function testReplaceMatch()
 {
     $this->assertSame('hallo … world.', $this->_paging->replaceMatch('hallo foo-bar world.', '…'));
     $this->assertSame('hallo $1 \\1 world.', $this->_paging->replaceMatch('hallo foo-bar world.', '$1 \\1'));
     $this->assertSame('Hello … world.', $this->_paging->replaceMatch('Hello zoo world.', '…'));
     $this->assertSame('Hello … world.', $this->_paging->replaceMatch('Hello sub.zoo.com world.', '…'));
 }
コード例 #2
0
ファイル: Badwords.php プロジェクト: NicolasSchmutz/cm
 public function transform($text, CM_Frontend_Render $render)
 {
     $text = (string) $text;
     $badwordList = new CM_Paging_ContentList_Badwords();
     $text = $badwordList->replaceMatch($text, '…');
     return $text;
 }