示例#1
0
/**
 * Shortcut to \PressBooks\Sanitize\strip_br();
 *
 * @param $val
 *
 * @return string
 */
function pb_strip_br($val)
{
    return \PressBooks\Sanitize\strip_br($val);
}
示例#2
0
 /**
  * @covers \PressBooks\Sanitize\strip_br
  */
 public function test_strip_br()
 {
     $test = 'Hello <br /> World!';
     $test = \PressBooks\Sanitize\strip_br($test);
     $this->assertEquals('Hello   World!', $test);
     $test = 'Hello <br/><br   /> World!';
     $test = \PressBooks\Sanitize\strip_br($test);
     $this->assertEquals('Hello    World!', $test);
     $test = 'Hello &lt;br /&gt; World!';
     $test = \PressBooks\Sanitize\strip_br($test);
     $this->assertEquals('Hello   World!', $test);
     $test = 'Hello &lt;br/&gt;&lt;br   /&gt; World!';
     $test = \PressBooks\Sanitize\strip_br($test);
     $this->assertEquals('Hello    World!', $test);
 }