2006-08-19 17:53:59 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
header('Content-type: text/html; charset=UTF-8');
|
|
|
|
|
2007-08-19 21:38:19 +00:00
|
|
|
if (!isset($_GET['standalone'])) {
|
|
|
|
require_once '../library/HTMLPurifier.auto.php';
|
|
|
|
} else {
|
|
|
|
require_once '../library/HTMLPurifier.standalone.php';
|
|
|
|
}
|
2007-01-16 22:22:08 +00:00
|
|
|
error_reporting(E_ALL);
|
2006-08-19 17:53:59 +00:00
|
|
|
|
|
|
|
function escapeHTML($string) {
|
2006-08-29 19:36:40 +00:00
|
|
|
$string = HTMLPurifier_Encoder::cleanUTF8($string);
|
2006-08-19 17:53:59 +00:00
|
|
|
$string = htmlspecialchars($string, ENT_COMPAT, 'UTF-8');
|
|
|
|
return $string;
|
|
|
|
}
|
|
|
|
|
2008-02-20 00:15:44 +00:00
|
|
|
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
|
|
|
|
function fix_magic_quotes(&$array) {
|
|
|
|
foreach ($array as $k => $val) {
|
|
|
|
if (!is_array($val)) {
|
|
|
|
$array[$k] = stripslashes($val);
|
|
|
|
} else {
|
|
|
|
fix_magic_quotes($array[$k]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fix_magic_quotes($_GET);
|
|
|
|
fix_magic_quotes($_POST);
|
|
|
|
fix_magic_quotes($_COOKIE);
|
|
|
|
fix_magic_quotes($_REQUEST);
|
|
|
|
fix_magic_quotes($_ENV);
|
|
|
|
fix_magic_quotes($_SERVER);
|
|
|
|
}
|