| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* MVC_Input |
| 5 |
* |
| 6 |
* @version 1.0 |
| 7 |
* |
| 8 |
* @author Sandi Winter |
| 9 |
* @link https://github.com/sandiwinter/winter_mvc |
| 10 |
*/ |
| 11 |
if ( ! class_exists( 'MVC_Input' ) ): |
| 12 |
|
| 13 |
class MVC_Input { |
| 14 |
|
| 15 |
public function __construct() |
| 16 |
{ |
| 17 |
} |
| 18 |
|
| 19 |
public function post($name = NULL) |
| 20 |
{ |
| 21 |
if($name === NULL) |
| 22 |
return wmvc_xss_clean_array(wmvc_stripslashes_deep($_POST)); |
| 23 |
|
| 24 |
if(isset($_POST[$name])) |
| 25 |
{ |
| 26 |
return wmvc_xss_clean(wmvc_stripslashes_deep($_POST[$name])); |
| 27 |
} |
| 28 |
|
| 29 |
return NULL; |
| 30 |
} |
| 31 |
|
| 32 |
public function get($name = NULL) |
| 33 |
{ |
| 34 |
if($name === NULL) |
| 35 |
return wmvc_xss_clean_array($_GET); |
| 36 |
|
| 37 |
if(isset($_GET[$name])) |
| 38 |
{ |
| 39 |
return wmvc_xss_clean($_GET[$name]); |
| 40 |
} |
| 41 |
|
| 42 |
return NULL; |
| 43 |
} |
| 44 |
|
| 45 |
public function post_get($name = NULL) |
| 46 |
{ |
| 47 |
if($name === NULL) |
| 48 |
return array_merge($_POST, $_GET); |
| 49 |
|
| 50 |
if(isset($_POST[$name])) |
| 51 |
{ |
| 52 |
return wmvc_xss_clean($_POST[$name]); |
| 53 |
} |
| 54 |
|
| 55 |
if(isset($_GET[$name])) |
| 56 |
{ |
| 57 |
return wmvc_xss_clean($_GET[$name]); |
| 58 |
} |
| 59 |
|
| 60 |
return NULL; |
| 61 |
} |
| 62 |
|
| 63 |
} |
| 64 |
|
| 65 |
endif; |
| 66 |
|
| 67 |
?> |