From 075ce4d29a4617b4374402f8a3f88efd2f1d5be4 Mon Sep 17 00:00:00 2001 From: nohn Date: Sun, 5 Nov 2006 11:25:03 +0000 Subject: [PATCH] * add filter for php 5.2.0 --- include/compat.inc.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/compat.inc.php b/include/compat.inc.php index ad5f90b..467968c 100644 --- a/include/compat.inc.php +++ b/include/compat.inc.php @@ -116,6 +116,21 @@ if (extension_loaded('filter') && function_exists('input_name_to_filter') && inp } } +if (extension_loaded('filter') && function_exists('filter_id') && filter_id(ini_get('filter.default')) !== FILTER_UNSAFE_RAW) { + foreach ($_POST as $key => $value) { + $_POST[$key] = filter_input(INPUT_POST, $key, FILTER_UNSAFE_RAW); + } + foreach ($_GET as $key => $value) { + $_GET[$key] = filter_input(INPUT_GET, $key, FILTER_UNSAFE_RAW); + } + foreach ($_COOKIE as $key => $value) { + $_COOKIE[$key] = filter_input(INPUT_COOKIE, $key, FILTER_UNSAFE_RAW); + } + foreach ($_SESSION as $key => $value) { + $_SESSION[$key] = filter_input(INPUT_SESSION, $key, FILTER_UNSAFE_RAW); + } +} + /* * Avoid magic_quotes_gpc issues * courtesy of iliaa@php.net -- 2.39.5