You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 line
964B

  1. <?php
  2. header('Content-type: text/html; charset=UTF-8');
  3. if (!isset($_GET['standalone'])) {
  4. require_once '../library/HTMLPurifier.auto.php';
  5. } else {
  6. require_once '../library/HTMLPurifier.standalone.php';
  7. }
  8. error_reporting(E_ALL);
  9. function escapeHTML($string)
  10. {
  11. $string = HTMLPurifier_Encoder::cleanUTF8($string);
  12. $string = htmlspecialchars($string, ENT_COMPAT, 'UTF-8');
  13. return $string;
  14. }
  15. if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
  16. function fix_magic_quotes(&$array)
  17. {
  18. foreach ($array as $k => $val) {
  19. if (!is_array($val)) {
  20. $array[$k] = stripslashes($val);
  21. } else {
  22. fix_magic_quotes($array[$k]);
  23. }
  24. }
  25. }
  26. fix_magic_quotes($_GET);
  27. fix_magic_quotes($_POST);
  28. fix_magic_quotes($_COOKIE);
  29. fix_magic_quotes($_REQUEST);
  30. fix_magic_quotes($_ENV);
  31. fix_magic_quotes($_SERVER);
  32. }
  33. // vim: et sw=4 sts=4