1 /* 2 +----------------------------------------------------------------------+ 3 | PHP Version 7 | 4 +----------------------------------------------------------------------+ 5 | Copyright (c) 1997-2017 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 #define PHP_FILTER_VERSION PHP_VERSION 42 43 PHP_MINIT_FUNCTION(filter); 44 PHP_MSHUTDOWN_FUNCTION(filter); 45 PHP_RINIT_FUNCTION(filter); 46 PHP_RSHUTDOWN_FUNCTION(filter); 47 PHP_MINFO_FUNCTION(filter); 48 49 PHP_FUNCTION(filter_input); 50 PHP_FUNCTION(filter_var); 51 PHP_FUNCTION(filter_input_array); 52 PHP_FUNCTION(filter_var_array); 53 PHP_FUNCTION(filter_list); 54 PHP_FUNCTION(filter_has_var); 55 PHP_FUNCTION(filter_id); 56 57 ZEND_BEGIN_MODULE_GLOBALS(filter) 58 zval post_array; 59 zval get_array; 60 zval cookie_array; 61 zval env_array; 62 zval server_array; 63 zval session_array; 64 zend_long default_filter; 65 zend_long default_filter_flags; 66 ZEND_END_MODULE_GLOBALS(filter) 67 68 #if defined(COMPILE_DL_FILTER) && defined(ZTS) 69 ZEND_TSRMLS_CACHE_EXTERN() 70 #endif 71 72 #define IF_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(filter, v) 73 74 #define PHP_INPUT_FILTER_PARAM_DECL zval *value, zend_long flags, zval *option_array, char *charset 75 void php_filter_int(PHP_INPUT_FILTER_PARAM_DECL); 76 void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL); 77 void php_filter_float(PHP_INPUT_FILTER_PARAM_DECL); 78 void php_filter_validate_regexp(PHP_INPUT_FILTER_PARAM_DECL); 79 void php_filter_validate_domain(PHP_INPUT_FILTER_PARAM_DECL); 80 void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL); 81 void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL); 82 void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL); 83 void php_filter_validate_mac(PHP_INPUT_FILTER_PARAM_DECL); 84 85 void php_filter_string(PHP_INPUT_FILTER_PARAM_DECL); 86 void php_filter_encoded(PHP_INPUT_FILTER_PARAM_DECL); 87 void php_filter_special_chars(PHP_INPUT_FILTER_PARAM_DECL); 88 void php_filter_full_special_chars(PHP_INPUT_FILTER_PARAM_DECL); 89 void php_filter_unsafe_raw(PHP_INPUT_FILTER_PARAM_DECL); 90 void php_filter_email(PHP_INPUT_FILTER_PARAM_DECL); 91 void php_filter_url(PHP_INPUT_FILTER_PARAM_DECL); 92 void php_filter_number_int(PHP_INPUT_FILTER_PARAM_DECL); 93 void php_filter_number_float(PHP_INPUT_FILTER_PARAM_DECL); 94 void php_filter_magic_quotes(PHP_INPUT_FILTER_PARAM_DECL); 95 96 void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL); 97 98 #endif /* FILTER_H */ 99 100 /* 101 * Local variables: 102 * tab-width: 4 103 * c-basic-offset: 4 104 * indent-tabs-mode: t 105 * End: 106 */ 107