X-Git-Url: http://git.dj3c1t.com/index.cgi?a=blobdiff_plain;f=web%2Fapp%2Finit%2F0200_inputs.php;h=265d0f9310536703318c188fe10ec68b3c304821;hb=29b6377f43bf4477e04b57069cf779ac1b913bdb;hp=e8759d06b5d29fcf530ea79b766b57f35f20f47f;hpb=a21fbfe1301f83b72d2815899ff334445b7830cf;p=mtweb diff --git a/web/app/init/0200_inputs.php b/web/app/init/0200_inputs.php index e8759d0..265d0f9 100644 --- a/web/app/init/0200_inputs.php +++ b/web/app/init/0200_inputs.php @@ -1,12 +1,12 @@ $v) - { unset($process[$key][$k]); - if(is_array($v)) - { $process[$key][stripslashes($k)] = $v; + if(get_magic_quotes_gpc()){ + $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST); + while(list($key, $val) = each($process)){ + foreach($val as $k => $v){ + unset($process[$key][$k]); + if(is_array($v)){ + $process[$key][stripslashes($k)] = $v; $process[] = &$process[$key][stripslashes($k)]; } else $process[$key][stripslashes($k)] = stripslashes($v); @@ -15,46 +15,4 @@ unset($process); } - - - /* - * - * decommentez la fin du fichier pour activer le filtrage - * des inputs (ici POST et FILES) - * - - if($_POST) - { require $this->path("libs")."inputfilter.php"; - $allowed_tags = array - ( "p", "span", "pre", "blockquote", "address", "hr", "br", - "img", - "strong", "em", "u", "i", "b", "s", - "a", - "ul", "ol", "li", - "h1", "h2", "h3", "h4", "h5", "h6" - ); - $allowed_attrs = array - ( "style", - "src", "alt", "width", "height", - "href", "title" - ); - $input_filter = new InputFilter($allowed_tags, $allowed_attrs); - $_POST = $input_filter->process($_POST); - } - - if($_FILES) - { foreach($_FILES as $file_key => $file_infos) - { $v_name = explode(".", $file_infos["name"]); - $ext = strtolower($v_name[count($v_name) - 1]); - if - ( $ext != "png" - && $ext != "jpg" - && $ext != "jpeg" - && $ext != "gif" - ) unset($_FILES[$file_key]); - } - } - - */ - ?> \ No newline at end of file