maj syntaxe accolades, maj jQuery, correction layout contact
[mtweb] / web / app / env / modules / mw_env_inputs.php
1 <?php
2
3   class mw_env_inputs extends mw_env{
4
5     function prepare_inputs(){
6       if($_POST){
7         require_once $this->path("libs")."inputfilter.php";
8         $allowed_tags = array(
9           "p", "span", "pre", "blockquote", "address", "hr", "br",
10           "img",
11           "strong", "em", "u", "i", "b", "s",
12           "a",
13           "ul", "ol", "li",
14           "h1", "h2", "h3", "h4", "h5", "h6"
15         );
16         $allowed_attrs = array(
17           "style",
18           "src", "alt", "width", "height",
19           "href", "title"
20         );
21         $input_filter = new InputFilter($allowed_tags, $allowed_attrs);
22         $_POST = $input_filter->process($_POST);
23       }
24       if($_FILES){
25         foreach($_FILES as $file_key => $file_infos){
26           $v_name = explode(".", $file_infos["name"]);
27           $ext = strtolower($v_name[count($v_name) - 1]);
28           if(
29                $ext != "png"
30             && $ext != "jpg"
31             && $ext != "jpeg"
32             && $ext != "gif"
33           ){
34             unset($_FILES[$file_key]);
35           }
36         }
37       }
38       return true;
39     }
40
41   }
42
43 ?>