1 /* 2 +----------------------------------------------------------------------+ 3 | PHP Version 5 | 4 +----------------------------------------------------------------------+ 5 | Copyright (c) 1997-2016 The PHP Group | 6 +----------------------------------------------------------------------+ 7 | This source file is subject to version 3.01 of the PHP license, | 8 | that is bundled with this package in the file LICENSE, and is | 9 | available through the world-wide-web at the following url: | 10 | http://www.php.net/license/3_01.txt | 11 | If you did not receive a copy of the PHP license and are unable to | 12 | obtain it through the world-wide-web, please send a note to | 13 | license@php.net so we can mail you a copy immediately. | 14 +----------------------------------------------------------------------+ 15 | Authors: Rasmus Lerdorf <rasmus@php.net> | 16 | Derick Rethans <derick@php.net> | 17 +----------------------------------------------------------------------+ 18 */ 19 20 /* $Id$ */ 21 22 #ifndef PHP_FILTER_H 23 #define PHP_FILTER_H 24 25 #include "SAPI.h" 26 #include "zend_API.h" 27 #include "php.h" 28 #include "php_ini.h" 29 #include "ext/standard/info.h" 30 #include "ext/standard/php_string.h" 31 #include "ext/standard/html.h" 32 #include "php_variables.h" 33 34 extern zend_module_entry filter_module_entry; 35 #define phpext_filter_ptr &filter_module_entry 36 37 #ifdef ZTS 38 #include "TSRM.h" 39 #endif 40 41 PHP_MINIT_FUNCTION(filter); 42 PHP_MSHUTDOWN_FUNCTION(filter); 43 PHP_RINIT_FUNCTION(filter); 44 PHP_RSHUTDOWN_FUNCTION(filter); 45 PHP_MINFO_FUNCTION(filter); 46 47 PHP_FUNCTION(filter_input); 48 PHP_FUNCTION(filter_var); 49 PHP_FUNCTION(filter_input_array); 50 PHP_FUNCTION(filter_var_array); 51 PHP_FUNCTION(filter_list); 52 PHP_FUNCTION(filter_has_var); 53 PHP_FUNCTION(filter_id); 54 55 ZEND_BEGIN_MODULE_GLOBALS(filter) 56 zval *post_array; 57 zval *get_array; 58 zval *cookie_array; 59 zval *env_array; 60 zval *server_array; 61 zval *session_array; 62 long default_filter; 63 long default_filter_flags; 64 ZEND_END_MODULE_GLOBALS(filter) 65 66 #ifdef ZTS 67 #define IF_G(v) TSRMG(filter_globals_id, zend_filter_globals *, v) 68 #else 69 #define IF_G(v) (filter_globals.v) 70 #endif 71 72 73 #define PHP_INPUT_FILTER_PARAM_DECL zval *value, long flags, zval *option_array, char *charset TSRMLS_DC 74 void php_filter_int(PHP_INPUT_FILTER_PARAM_DECL); 75 void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL); 76 void php_filter_float(PHP_INPUT_FILTER_PARAM_DECL); 77 void php_filter_validate_regexp(PHP_INPUT_FILTER_PARAM_DECL); 78 void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL); 79 void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL); 80 void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL); 81 void php_filter_validate_mac(PHP_INPUT_FILTER_PARAM_DECL); 82 83 void php_filter_string(PHP_INPUT_FILTER_PARAM_DECL); 84 void php_filter_encoded(PHP_INPUT_FILTER_PARAM_DECL); 85 void php_filter_special_chars(PHP_INPUT_FILTER_PARAM_DECL); 86 void php_filter_full_special_chars(PHP_INPUT_FILTER_PARAM_DECL); 87 void php_filter_unsafe_raw(PHP_INPUT_FILTER_PARAM_DECL); 88 void php_filter_email(PHP_INPUT_FILTER_PARAM_DECL); 89 void php_filter_url(PHP_INPUT_FILTER_PARAM_DECL); 90 void php_filter_number_int(PHP_INPUT_FILTER_PARAM_DECL); 91 void php_filter_number_float(PHP_INPUT_FILTER_PARAM_DECL); 92 void php_filter_magic_quotes(PHP_INPUT_FILTER_PARAM_DECL); 93 94 void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL); 95 96 #endif /* FILTER_H */ 97 98 /* 99 * Local variables: 100 * tab-width: 4 101 * c-basic-offset: 4 102 * indent-tabs-mode: t 103 * End: 104 */ 105