xref: /PHP-7.4/ext/filter/php_filter.h (revision cd2f2cd7)
1 /*
2   +----------------------------------------------------------------------+
3   | PHP Version 7                                                        |
4   +----------------------------------------------------------------------+
5   | Copyright (c) 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 #ifndef PHP_FILTER_H
21 #define PHP_FILTER_H
22 
23 #include "SAPI.h"
24 #include "zend_API.h"
25 #include "php.h"
26 #include "php_ini.h"
27 #include "ext/standard/info.h"
28 #include "ext/standard/php_string.h"
29 #include "ext/standard/html.h"
30 #include "php_variables.h"
31 
32 extern zend_module_entry filter_module_entry;
33 #define phpext_filter_ptr &filter_module_entry
34 
35 #ifdef ZTS
36 #include "TSRM.h"
37 #endif
38 
39 #define PHP_FILTER_VERSION PHP_VERSION
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 #if 0
62 	zval session_array;
63 #endif
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_add_slashes(PHP_INPUT_FILTER_PARAM_DECL);
95 void php_filter_magic_quotes(PHP_INPUT_FILTER_PARAM_DECL);
96 
97 void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL);
98 
99 #endif	/* FILTER_H */
100