2006-08-19 17:53:59 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
header('Content-type: text/html; charset=UTF-8');
|
|
|
|
|
2022-09-15 03:55:41 +00:00
|
|
|
require_once __DIR__.'/../vendor/autoload.php';
|
|
|
|
|
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
|
|
|
|
2013-07-16 11:56:14 +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()) {
|
2013-07-16 11:56:14 +00:00
|
|
|
function fix_magic_quotes(&$array)
|
|
|
|
{
|
2008-02-20 00:15:44 +00:00
|
|
|
foreach ($array as $k => $val) {
|
|
|
|
if (!is_array($val)) {
|
|
|
|
$array[$k] = stripslashes($val);
|
|
|
|
} else {
|
|
|
|
fix_magic_quotes($array[$k]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2008-02-20 00:15:44 +00:00
|
|
|
fix_magic_quotes($_GET);
|
|
|
|
fix_magic_quotes($_POST);
|
|
|
|
fix_magic_quotes($_COOKIE);
|
|
|
|
fix_magic_quotes($_REQUEST);
|
|
|
|
fix_magic_quotes($_ENV);
|
|
|
|
fix_magic_quotes($_SERVER);
|
|
|
|
}
|
2008-12-06 09:24:59 +00:00
|
|
|
|
|
|
|
// vim: et sw=4 sts=4
|