[ Index ]
 

Code source de SPIP Agora 1.4

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/Agora1-4/safehtml-1.3.7/tests/ -> testcases_htmlsax2.php (source)

   1  <?php
   2  /*
   3  
   4      Example for Safehtml
   5  
   6  */
   7  
   8  require_once  ('../classes/safehtml.php');
   9  
  10  $doc = '
  11  <a href="' . "\x1B" . 'javascript:alert(1)">12</a>b<br/> 
  12  <a href="' . "\x1C" . 'javascript:alert(1)">12</a>c<br/> 
  13  <a href="' . "\x1D" . 'javascript:alert(1)">12</a>d<br/> 
  14  <a href="' . "\x1E" . 'javascript:alert(1)">12</a>e<br/> 
  15  <a href="j' . "\x00" . 'avascript:alert(1)">12</a>e<br/> 
  16  ';
  17  
  18  // Instantiate the handler
  19  $safehtml = &new safehtml();
  20  $safehtml->protocolFiltering = "black";
  21  
  22  $result = $safehtml->parse($doc);
  23  
  24  echo ('<b>Source code before filtration:</b><br/>');
  25  echo (htmlspecialchars($doc));
  26  
  27  echo ('<p><b>Code before filtration as is (HTML):</b><br/>');
  28  echo ($doc);
  29  
  30  echo ('<p><b>Source code after filtration:</b><br/>');
  31  echo (htmlspecialchars($result));
  32  
  33  echo ('<p><b>Code after filtration as is (HTML):</b><br/>');
  34  echo ($result);
  35  ?>


Généré le : Sat Feb 24 14:40:03 2007 par Balluche grâce à PHPXref 0.7