noTags() public static method

This will utilize the PHP Filter extension if available
public static noTags ( mixed $value ) : mixed
$value mixed
return mixed
Exemplo n.º 1
0
$d['lowascii'] = '    ';
$d[] = array('foo', 'bar<br />', 'yes<P>', 1776);
$d['x']['woot'] = array('booyah' => 'meet at the bar at 7:30 pm', 'ultimate' => '<strong>hi there!</strong>');
$d['lemon'][][][][][][][][][][][][][][] = 'far';
?>
<h2>A crazy, crazy array ($d)</h2>
<?php 
echo "<pre>";
var_dump($d);
echo "</pre>\n";
?>


<h2>Inspekt::noTags($d)</h2>
<?php 
$newd = Inspekt::noTags($d);
echo "<pre>";
var_dump($newd);
echo "</pre>\n";
?>


<h2>Inspekt::noTagsOrSpecial($d)</h2>
<?php 
$newd = Inspekt::noTagsOrSpecial($d);
echo "<pre>";
var_dump($newd);
echo "</pre>\n";
?>

Exemplo n.º 2
0
 /**
  *
  */
 public function testNoTags()
 {
     $input = '<SCRIPT>alert(\'foobar\');</SCRIPT>';
     $expect = 'alert(\'foobar\');';
     $this->assertSame($expect, Inspekt::noTags($input));
 }